Skip to content

fix(worktree): treat non-git project paths as having no archive ref#2

Open
Antisophy wants to merge 1 commit into
CyberShadow:masterfrom
Antisophy:fix/worktree-non-git-archive-ref
Open

fix(worktree): treat non-git project paths as having no archive ref#2
Antisophy wants to merge 1 commit into
CyberShadow:masterfrom
Antisophy:fix/worktree-non-git-archive-ref

Conversation

@Antisophy

Copy link
Copy Markdown

Problem

getArchiveRefState threw on any git exit 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) makes git rev-parse exit 128, which aborted the whole archive transition. Unarchiving such a task failed with "not a git repository".

Fix

Short-circuit to Missing when the path isn't inside a work tree (git rev-parse --is-inside-work-tree exits non-zero), before the strict status check. This restores the pre-8225c1e tolerance for non-git paths while still throwing on genuine git failures inside a real repo.

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.
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