Skip to content

fix(conflicts): stage gitlink submodule paths with git add - #116

Draft
patrick-cst1 wants to merge 1 commit into
the0807:mainfrom
patrick-cst1:fix/issue-94-submodule-conflict-stage
Draft

patrick-cst1 wants to merge 1 commit into
the0807:mainfrom
patrick-cst1:fix/issue-94-submodule-conflict-stage

Conversation

@patrick-cst1

Copy link
Copy Markdown

Summary

  • Lists conflicts from the index (git ls-files --unmerged) instead of a working-tree git diff, and stages still-unmerged paths with an explicit git add -- <path> on continue (falling back to the previous add -A when nothing is unmerged).

Related Issue

Refs #94

Changes

  • GitService.getConflictFiles() + continueOperation().
  • Unit tests for gitlink listing (three mode-160000 stage entries collapse to one path), mixed file/gitlink conflicts and continue staging.

Type of Change

  • Bug fix
  • Test addition or update

Testing

  • New tests fail on unmodified main and pass with the change.- npx tsc --noEmit clean.
  • Full suite on Windows: 260 pre-existing failures (POSIX-only integration helper + env), 0 new failures vs main; focused tests pass.
  • The repo's integration suite only runs on Linux (its helper uses POSIX quoting), CI covers those.

Caveats (draft)

  • I built a real gitlink merge conflict with git 2.55 and could not reproduce the reported symptom: git diff --name-only --diff-filter=U already listed the submodule and git add staged 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).

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