locked-worktree
worktree
primary worktree on main + 1 linked worktree locked with a reason
Description
A repository with one linked worktree that has been locked via `git worktree lock`. Locked worktrees appear in `git worktree list` with a `locked <reason>` annotation and resist removal without `--force`. Useful for testing: - worktree list rendering when a worktree is locked - locked-worktree badge / indicator in the worktree panel - error handling when trying to delete a locked worktree - unlock flow (`git worktree unlock`) before safe removal
Contracts
- 1 linked worktree exists
- the linked worktree is locked
- git worktree list --porcelain shows locked with a reason
- .git/worktrees/ has a locked file for the linked worktree
Tags
Branches
hotfix/reservedmain Use it
import { spinUpScenario } from '@gfargo/git-scenarios'
const repo = await spinUpScenario('locked-worktree') npx git-scenarios create locked-worktree import { describeWithScenario } from '@gfargo/git-scenarios/jest'
describeWithScenario('locked-worktree', (getRepo) => {
it('should have the expected state', async () => {
const repo = getRepo()
// your assertions here
})
}) Commit graph
* c949dcc (HEAD -> main, hotfix/reserved) chore: initial scaffold