Repository navigation
Fix checkout errors blaming the working directory (issue #629) - #630
Merged
Merged
Conversation
goneng
marked this pull request as ready for review
September 13, 2026 10:29
Contributor
|
Unfortunately, it comes with a conflict |
goneng
force-pushed
the
fix-checkout-error-message
branch
from
September 13, 2026 10:40
64715eb to
911a6dd
Compare
goneng
marked this pull request as draft
September 13, 2026 11:20
goneng
force-pushed
the
fix-checkout-error-message
branch
from
September 13, 2026 11:37
911a6dd to
8fcc04e
Compare
git says why it refused, and GitX said something else. Checking out a branch that is checked out in another worktree fails with "fatal: 'x' is already used by worktree at ...", and the sheet answered "Perhaps your working directory is not clean?", which sends the reader looking for changes that are not there. The same guess stood in for every failure of the two checkouts and of cherry pick. * Report the failed task's own output as the failure reason, keeping the guess for a failure that produced none * Cover the worktree refusal, and both fallbacks, with tests that need no git on the machine
goneng
force-pushed
the
fix-checkout-error-message
branch
from
September 13, 2026 19:43
8fcc04e to
110ad54
Compare
goneng
marked this pull request as ready for review
September 13, 2026 19:55
Collaborator
Author
(rebased - thanks) |
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.
git says why it refused, and GitX said something else.
First slice of #629. Checking out a branch that is checked out in another
worktree fails with
and the sheet answered "Perhaps your working directory is not clean?", which
sends you looking for uncommitted changes that are not there. git's own text
did reach the sheet, but further down under "Output:", below a headline that
contradicted it.
The same canned guess stood in for every failure of
checkoutRefish:,checkoutFiles:fromRefish:andcherryPickRefish:, so all three now lead withwhat git said. Worktrees are only the case that made it obvious.
for a failure that produced no output (a signal or a timeout)
on the machine
Nothing here teaches GitX about worktrees. Marking those branches and offering
to open them is the rest of #629.
Test plan
make unit-test: 105 tests, 0 failures, 4 of them new (inPBGitRepositoryCheckoutErrorTests)before,
testGitsOwnRefusalIsReportedInsteadOfTheGuessandtestGitsOutputIsTrimmedfaildo not depend on
[PBGitBinary path]resolving on the runner, which Keep the unit tests from depending on the machine they run on #620had to clean up elsewhere
One known wart
The sheet now prints git's message twice: once as the headline, and again in
the "Output:" block that
PBGitXMessageSheetappends for any task error.Suppressing the second copy means touching the sheet for every error it shows,
which I kept out of this PR. Happy to follow up if you would rather have it.