merge-conflict-delete-modify
operation
in-progress merge with a delete/modify conflict on src/component.ts
Description
A repository mid-merge, blocked on a delete/modify conflict. `main` deleted `src/component.ts` while `feat/x` modified it. Running `git merge feat/x` on `main` detected the conflict and left the merge uncommitted. Unlike content conflicts, there are no in-file conflict markers. Git leaves `src/component.ts` in the worktree with the content from `feat/x` (the modifying side). The conflict is expressed as a `DU` entry in `git status --porcelain` (deleted by us, modified by them). Useful for testing: - conflict views that must handle delete-side conflicts - tools that show "deleted by us" in their conflicts UI - the "keep theirs / remove file" resolution paths
Contracts
- main is checked out
- a merge is in progress (MERGE_HEAD exists)
- src/component.ts was deleted on main but modified on feat/x
- src/component.ts exists in the worktree with feat/x content (no conflict markers)
- exactly 1 unresolved conflict (DU status: deleted by us, modified by them)
Tags
Branches
feat/xmain Use it
import { spinUpScenario } from '@gfargo/git-scenarios'
const repo = await spinUpScenario('merge-conflict-delete-modify') npx git-scenarios create merge-conflict-delete-modify import { describeWithScenario } from '@gfargo/git-scenarios/jest'
describeWithScenario('merge-conflict-delete-modify', (getRepo) => {
it('should have the expected state', async () => {
const repo = getRepo()
// your assertions here
})
}) Commit graph
* 3685503 (feat/x) feat: update component to v2
| * da99c48 (HEAD -> main) refactor: remove component
|/
* 6626e42 feat: add component
* f4ee0a9 chore: initial scaffold