feat(copy): add --work-dir option and extract shared repo_utils#22
Merged
EspenAlbert merged 3 commits intomainfrom Feb 17, 2026
Merged
feat(copy): add --work-dir option and extract shared repo_utils#22EspenAlbert merged 3 commits intomainfrom
EspenAlbert merged 3 commits intomainfrom
Conversation
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.
Summary
Add
--work-diroption topath-sync copy, matching the existingdep-updatebehavior. When set, destination repos are cloned into{work-dir}/{dest.name}instead of resolving fromdest_path_relativerelative tosrc_root.Extract shared repo-resolution logic (
resolve_repo_path,ensure_repo) intorepo_utils.pyso both commands use the same code path.Reviewer notes
ensure_repoonly ensures existence: it clones missing repos, prompts to re-clone invalid ones, and returns theRepofor existing valid repos. It does not fetch or reset. The fetch-and-reset responsibility stays withprepare_copy_branch(from_default=True), whichdep-updatealways uses andcopyuses only when--checkout-from-defaultis set.ensure_repobehavior change fordep-update: previously_ensure_reporaisedtyper.Abort()on user decline; now raisesValueError. This avoids the typer dependency in the shared module.dest_path_relativeremains required onDestination: when--work-diris set, the field is ignored. Making it optional (defaulting to"") could be a follow-up if configs want to drop it entirely.