git-lfs-pointer
worktree
repo with a Git LFS pointer file committed for a binary asset (no lfs binary required)
Description
A binary asset (`assets/blob.bin`) is tracked by Git LFS. The file on
disk is the plain-text *pointer stub* — the real binary object would
live on an LFS server that this scenario does not configure.
`.gitattributes` marks `*.bin` with `filter=lfs diff=lfs merge=lfs -text`.
The `-text` attribute is required to prevent CRLF mangling of the pointer
text on Windows.
Platform notes:
- No `git-lfs` binary is needed — the pointer is written as plain text,
so the scenario passes everywhere without the LFS extension installed.
- Tools that call `git lfs checkout` or `git lfs pull` will fail unless
`git-lfs` is installed; test only pointer detection and attribute rules.
- The oid and size in `assets/blob.bin` are hardcoded constants and do
not correspond to any real LFS object.
Useful for testing:
- LFS pointer detection ("is this file an LFS pointer?")
- UI badges or warnings for LFS-managed paths
- `.gitattributes` rule parsing (`filter=lfs`, `diff=lfs`, `-text`) Contracts
- main is checked out
- main has 2 commits
- .gitattributes marks *.bin as LFS-tracked (filter=lfs diff=lfs merge=lfs -text)
- assets/blob.bin contains a canonical LFS pointer (version + oid sha256 + size)
- worktree is clean
Tags
Branches
main Use it
import { spinUpScenario } from '@gfargo/git-scenarios'
const repo = await spinUpScenario('git-lfs-pointer') npx git-scenarios create git-lfs-pointer import { describeWithScenario } from '@gfargo/git-scenarios/jest'
describeWithScenario('git-lfs-pointer', (getRepo) => {
it('should have the expected state', async () => {
const repo = getRepo()
// your assertions here
})
}) Commit graph
* b7b3122 (HEAD -> main) feat: add lfs-tracked binary asset
* 7520170 chore: initial