merge-conflict-add-add
operation
in-progress merge with an add/add conflict on src/config.ts
Description
A repository mid-merge, blocked on an add/add conflict. Both `main` and `feat/x` independently added `src/config.ts` with different environment values. Running `git merge feat/x` on `main` detected the conflicting additions and left the merge uncommitted. Unlike rename/rename and delete/modify conflicts, git does inject conflict markers here — the file has `<<<<<<<`, `=======`, and `>>>>>>>` sections showing both versions. The conflict appears as an `AA` (added by both) entry in `git status --porcelain`. Useful for testing: - conflict views on newly-created files (no shared ancestor) - add/add distinction from standard content (UU) conflicts - merge resolution flows where neither side has a "base"
Contracts
- main is checked out
- a merge is in progress (MERGE_HEAD exists)
- src/config.ts was independently added on both branches with different content
- src/config.ts has unresolved conflict markers
- exactly 1 unresolved conflict (AA status: added by both)
Tags
Branches
feat/xmain Use it
import { spinUpScenario } from '@gfargo/git-scenarios'
const repo = await spinUpScenario('merge-conflict-add-add') npx git-scenarios create merge-conflict-add-add import { describeWithScenario } from '@gfargo/git-scenarios/jest'
describeWithScenario('merge-conflict-add-add', (getRepo) => {
it('should have the expected state', async () => {
const repo = getRepo()
// your assertions here
})
}) Commit graph
* 3c5fcfd (HEAD -> main) feat: add config for production
| * d9e1e2e (feat/x) feat: add config for development
|/
* f4ee0a9 chore: initial scaffold