fix(conflicts): stage gitlink submodule paths with git add - #116
Draft
patrick-cst1 wants to merge 1 commit into
Draft
patrick-cst1 wants to merge 1 commit into
patrick-cst1 wants to merge 1 commit into
Conversation
A rebase conflict on a submodule pointer leaves three mode-160000 stage entries for the submodule path in the superproject index. Conflict discovery used git diff --name-only --diff-filter=U, a working-tree diff that can omit gitlink entries, so the submodule could be missing from the conflict banner and never staged; continue then relied on a blanket git add -A. List conflicts with git ls-files --unmerged (the index is the source of truth; the three stage entries collapse to one path) and, when continuing, stage the still-unmerged paths explicitly with git add -- <path> - the same command that works by hand for a submodule - keeping unrelated working-tree edits out of the commit. The per-file mark-resolved action already used git add -- <path>.
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
git ls-files --unmerged) instead of a working-treegit diff, and stages still-unmerged paths with an explicitgit add -- <path>on continue (falling back to the previousadd -Awhen nothing is unmerged).Related Issue
Refs #94
Changes
GitService.getConflictFiles()+continueOperation().Type of Change
Testing
mainand pass with the change.-npx tsc --noEmitclean.main; focused tests pass.Caveats (draft)
git diff --name-only --diff-filter=Ualready listed the submodule andgit addstaged it, so this is defensive hardening rather than a confirmed fix. Keeping it as a draft until the reporter can confirm the exact scenario (git version,git status, extension log).