branch-diverged
branch
main is 2 ahead AND 2 behind origin/main, worktree clean
Description
`main` has diverged from `origin/main` — both sides have commits the other doesn't. The merge base is `HEAD~2` on the local side. Useful for testing: - "diverged" warning rendering (pull --rebase / merge prompts) - ahead/behind dual counts in branch lists - conflict-aware sync workflows
Contracts
- main is checked out
- main has 4 commits
- main is 2 ahead and 2 behind origin/main
- main tracks origin/main
- worktree is clean
Tags
Branches
main Use it
import { spinUpScenario } from '@gfargo/git-scenarios'
const repo = await spinUpScenario('branch-diverged') npx git-scenarios create branch-diverged import { describeWithScenario } from '@gfargo/git-scenarios/jest'
describeWithScenario('branch-diverged', (getRepo) => {
it('should have the expected state', async () => {
const repo = getRepo()
// your assertions here
})
}) Commit graph
* a64cf51 (HEAD -> main) local N
* 3d6bc88 local M
| * 6b28d74 (origin/main) upstream Y
| * 2b2b356 upstream X
|/
* e657666 feat: shared baseline
* 7520170 chore: initial