Expand description
Whether a blob is a Git LFS pointer, decided as git-lfs decides it.
What:
Whether a blob is a Git LFS pointer, decided the way git-lfs 3.8.1 decides it when it scans a push.
Why:
The upload step finds the LFS objects the pushed commits introduce without starting git-lfs. A blob counts when
the scanner would hand it to the transfer queue: smaller than the cutoff (lfs/scanner.go, BlobSizeCutoff), a
header that names git-media, hawser or git-lfs (lfs/pointer.go, matcherRE), lines in the order version,
oid, size with a known version, an sha256: object name of 64 lower-case hexadecimal digits and a non-negative
decimal size; a pointer of size zero is skipped by prepareUpload (commands/uploader.go). The path of the blob and
.gitattributes play no part. A spelling the port is not sure about (extension lines, non-ASCII edges) is a
decline, so the caller falls back to git-lfs itself.
In TS you’d write (pseudocode):
const verdict = decodePointer(blob); // { kind: 'not-a-pointer' } | { kind: 'pointer', oid, size } | { kind: 'decline' }Enums§
- Verdict
- What a blob is.
Constants§
- BLOB_
SIZE_ CUTOFF - The blob size from which a blob is never read as a pointer.
Functions§
- decode_
pointer - What:
The verdict for the content of one blob.
Why:
One pass over at most
BLOB_SIZE_CUTOFFbytes.