merge-conflict-rename-rename
operation
in-progress merge with a rename/rename conflict (orig.txt → two different names)
Description
A repository mid-merge, blocked on a rename/rename conflict. `main` renamed `orig.txt` to `main-name.txt`; `feat/x` renamed the same file to `feat-name.txt`. Running `git merge feat/x` on `main` detected the conflicting renames and left the merge uncommitted. Unlike content conflicts, there are no in-file conflict markers. Both renamed files exist in the worktree as ordinary files; the conflict is expressed as unresolved index entries (`AU`, `UA`, `DD` in `git status --porcelain`). `orig.txt` is absent because both sides deleted it (via the rename). Useful for testing: - conflict views that must handle non-marker conflict types - rename detection and display in diff/status tools - tooling that reads git index stage entries (stages 1-3)
Contracts
- main is checked out
- a merge is in progress (MERGE_HEAD exists)
- orig.txt was renamed to main-name.txt on main and to feat-name.txt on feat/x
- main-name.txt and feat-name.txt both exist in the worktree (no conflict markers)
- orig.txt is absent from the worktree (DD — deleted by both sides)
- at least 2 unresolved conflicts (AU/UA/DD index entries)
Tags
Branches
feat/xmain Use it
import { spinUpScenario } from '@gfargo/git-scenarios'
const repo = await spinUpScenario('merge-conflict-rename-rename') npx git-scenarios create merge-conflict-rename-rename import { describeWithScenario } from '@gfargo/git-scenarios/jest'
describeWithScenario('merge-conflict-rename-rename', (getRepo) => {
it('should have the expected state', async () => {
const repo = getRepo()
// your assertions here
})
}) Commit graph
* 5ef56bd (HEAD -> main) refactor: rename orig.txt to main-name.txt
| * 78644df (feat/x) refactor: rename orig.txt to feat-name.txt
|/
* 740a739 chore: add shared file
* f4ee0a9 chore: initial scaffold