fix(worktree): treat non-git project paths as having no archive ref#2
Open
Antisophy wants to merge 1 commit into
Open
fix(worktree): treat non-git project paths as having no archive ref#2Antisophy wants to merge 1 commit into
Antisophy wants to merge 1 commit into
Conversation
getArchiveRefState threw on any git exit status other than 0 or 1, so a project path that isn't a git work tree (e.g. an "unrestricted" workspace rooted at $HOME) made git rev-parse exit 128 and aborted the whole archive transition. Unarchiving such a task failed with "not a git repository". Short-circuit to Missing when the path isn't inside a work tree, before the strict status check, restoring the pre-8225c1e tolerance while still throwing on genuine git failures inside a real repo.
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.
Problem
getArchiveRefStatethrew on anygitexit status other than 0 or 1. A project path that isn't a git work tree (e.g. an "unrestricted" workspace rooted at a plain directory like$HOME) makesgit rev-parseexit 128, which aborted the whole archive transition. Unarchiving such a task failed with "not a git repository".Fix
Short-circuit to
Missingwhen the path isn't inside a work tree (git rev-parse --is-inside-work-treeexits non-zero), before the strict status check. This restores the pre-8225c1etolerance for non-git paths while still throwing on genuine git failures inside a real repo.