detached-head
branch
HEAD detached at main~2, worktree clean
Description
HEAD is detached at `main~2`. The `main` branch still exists at its original tip — only HEAD has moved off it. Useful for testing: - detached-HEAD banners / warnings in TUIs - "make this a branch?" affordances - status-bar branch indicators when there's no current branch
Contracts
- HEAD is detached
- main still exists as a branch
- main has 4 commits
- HEAD is 2 commits behind main
- worktree is clean
Tags
Branches
(HEAD detached at 1ab1c9c)main Use it
import { spinUpScenario } from '@gfargo/git-scenarios'
const repo = await spinUpScenario('detached-head') npx git-scenarios create detached-head import { describeWithScenario } from '@gfargo/git-scenarios/jest'
describeWithScenario('detached-head', (getRepo) => {
it('should have the expected state', async () => {
const repo = getRepo()
// your assertions here
})
}) Commit graph
* 34c4535 (main) feat: three
* 3c9536f feat: two
* 1ab1c9c (HEAD) feat: one
* 7520170 chore: initial