Repository navigation
fix(push): preserve FETCH_HEAD when refreshing a self-mode checkout - #1936
Merged
Merged
Conversation
embrace897
force-pushed
the
embrace897/self-fetch-head
branch
from
November 26, 2026 14:38
d67eb63 to
9cd17bc
Compare
|
No findings in the specified PR diff. The PR description documents sufficient testing: a representative built-CLI E2E run reproduces the baseline failure, verifies Review was read-only; I did not run, build, or install PR code. |
jeff-r2026
approved these changes
Nov 27, 2026
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.
Summary
Refresh the default remote-tracking branch without writing FETCH_HEAD when preparing a self-mode knowledge worktree on Git 2.29 or newer. Older Git versions continue to use the existing fetch command. The preview can still compare the workspace against current upstream content.
Type of Change
Bug fix.
Test Plan
npm run buildandnpm run typecheckpassed on Windows, Node 24.15.0, Git 2.56.0.npx vitest run src/__tests__/dry-run-load-path.test.ts -t "fresh self-mode clone" --retry 0passed six cases, including the preview with no prior FETCH_HEAD.npx vitest run --config vitest.e2e.config.ts src/__tests__/e2e/self-mode-push-behind.test.ts -t "pushes only the member" --retry 0against the built CLI. The baseline overwrote FETCH_HEAD. The fix preserves the file, updates origin/main, and publishes only the member's new file on a subsequent real push to the local bare remote.git diff --checkpassed.family-factsfalse positives tracked by fix(lint): resolve family facts imports on Windows #1927.verify:worldrequires POSIX. The E2E used the locally built CLI with an isolated HOME and a local Git remote. Git older than 2.29 was not exercised.Related Issues
Refs #1880 (the self-mode FETCH_HEAD subproblem).
Notes for Reviewers
AI-assisted. The flag is limited to the initial fetch from the business checkout in self mode. The separate default-branch preview paths that read FETCH_HEAD are outside this change.