Skip to content

Archive remote output branches without creating local heads - #125

Merged
schmoelder merged 1 commit into
mainfrom
non-mutating-cache-copy
Aug 13, 2026
Merged

Archive remote output branches without creating local heads#125
schmoelder merged 1 commit into
mainfrom
non-mutating-cache-copy

Conversation

@schmoelder

@schmoelder schmoelder commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

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 as origin/<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.

Base automatically changed from non-mutating-output-log to main August 13, 2026 09:54
@schmoelder
schmoelder force-pushed the non-mutating-cache-copy branch from de49fd3 to d7e6d2c Compare August 13, 2026 09:54
@schmoelder
schmoelder force-pushed the non-mutating-cache-copy branch from d7e6d2c to fad4253 Compare August 13, 2026 09:55
@schmoelder
schmoelder force-pushed the non-mutating-cache-copy branch from fad4253 to 04a44de Compare August 13, 2026 15:52
@schmoelder
schmoelder merged commit f08fa46 into main Aug 13, 2026
5 checks passed
@schmoelder
schmoelder deleted the non-mutating-cache-copy branch August 13, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant