Archive remote output branches without creating local heads - #125
Merged
Conversation
schmoelder
force-pushed
the
non-mutating-cache-copy
branch
from
August 13, 2026 09:54
de49fd3 to
d7e6d2c
Compare
schmoelder
force-pushed
the
non-mutating-cache-copy
branch
from
August 13, 2026 09:55
d7e6d2c to
fad4253
Compare
schmoelder
force-pushed
the
non-mutating-cache-copy
branch
from
August 13, 2026 15:52
fad4253 to
04a44de
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ProjectRepo.copy_data_to_cache(branch)avoided checking out the output branch, but it still created a local branch when the requested result only existed asorigin/<branch>. That meant loading cached data could still mutate local Git refs.This PR changes the cache path to archive the remote ref directly. If branch exists locally, it still archives the local branch. If it does not exist locally, it archives
origin/<branch>directly without creating a local head.The regression test sets up a result branch that only exists as a remote-tracking ref, calls
copy_data_to_cache(), and checks that the cached result is copied while the output repository state and local branch list stay unchanged.This is not intended as a breaking change. It removes another unintended side effect from a read/cache operation. Code that relied on
copy_data_to_cache()creating a local output branch would behave differently, but callers can create that branch explicitly if they need it.