Skip to content

feat(copy): add --work-dir option and extract shared repo_utils#22

Merged
EspenAlbert merged 3 commits intomainfrom
copy-workdir
Feb 17, 2026
Merged

feat(copy): add --work-dir option and extract shared repo_utils#22
EspenAlbert merged 3 commits intomainfrom
copy-workdir

Conversation

@EspenAlbert
Copy link
Copy Markdown
Owner

@EspenAlbert EspenAlbert commented Feb 17, 2026

Summary

Add --work-dir option to path-sync copy, matching the existing dep-update behavior. When set, destination repos are cloned into {work-dir}/{dest.name} instead of resolving from dest_path_relative relative to src_root.

Extract shared repo-resolution logic (resolve_repo_path, ensure_repo) into repo_utils.py so both commands use the same code path.

Reviewer notes

  • ensure_repo only ensures existence: it clones missing repos, prompts to re-clone invalid ones, and returns the Repo for existing valid repos. It does not fetch or reset. The fetch-and-reset responsibility stays with prepare_copy_branch(from_default=True), which dep-update always uses and copy uses only when --checkout-from-default is set.
  • ensure_repo behavior change for dep-update: previously _ensure_repo raised typer.Abort() on user decline; now raises ValueError. This avoids the typer dependency in the shared module.
  • dest_path_relative remains required on Destination: when --work-dir is set, the field is ignored. Making it optional (defaulting to "") could be a follow-up if configs want to drop it entirely.

@EspenAlbert EspenAlbert changed the title todo update me with the PR title for branch copy-workdir Copy Workdir Feb 17, 2026
@EspenAlbert EspenAlbert marked this pull request as ready for review February 17, 2026 17:10
@EspenAlbert EspenAlbert changed the title Copy Workdir feat(copy): add --work-dir option and extract shared repo_utils Feb 17, 2026
@EspenAlbert EspenAlbert merged commit 838963a into main Feb 17, 2026
14 checks passed
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