Add Path targeting to Git helpers - #108
Merged
Merged
Conversation
Thread a consistent -Path repository context through status, worktree, sync, stale branch, and update helpers so callers can operate on another repository without changing their location. Route git calls through git -C for explicit paths and validate non-git paths with clear errors while preserving existing current-directory behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b98f01a0-a039-492f-8576-b1917e54742d
…-path-parameter # Conflicts: # modules/Shmuelie.Git/CHANGELOG.md # modules/Shmuelie.Git/Public/Update-Worktrees.ps1 # modules/Shmuelie.Git/Public/Worktrees.ps1 # modules/Shmuelie.Git/README.md # tests/Shmuelie.Git.Tests.ps1
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.
Adds a consistent optional repository
-Pathcontext to Git helpers so callers can target another working tree without changing their current location.Final combined behavior:
git -C <path>.-Pathis omitted.-WorktreePathdestination parameter onNew-WorktreeandAdd-Worktree; these commands now support both source-Pathand destination-WorktreePath.Remove-WorktreeandSet-Worktree-Pathsemantics as target worktree paths, not repository contexts, because the target path fully identifies the worktree.Update-WorktreesInProgresshandling andOperationresult field while adding repository-Pathtargeting.Pathinput, invalid paths,-WorktreePathcoexistence, and in-progress update handling.Validation:
./build/Test-Modules.ps1./build/Invoke-Tests.ps1 -Path tests/Shmuelie.Git.Tests.ps1./build/Invoke-Tests.ps1Closes #27