Skip to main content

is_git_lfs_pointer

Function is_git_lfs_pointer 

Source
pub fn is_git_lfs_pointer(content: &[u8]) -> bool
Expand description

True if content is a whole Git-LFS pointer file: a version line, then an oid line, then a size line, in that spec-mandated order. Lines that are none of the three (e.g. optional ext-* lines, or blank lines) are tolerated between the anchors, matching real pointers.

Cheap: an O(n) single pass over the (tiny, <200 byte) pointer, and callers that scan large files should gate on the size/prefix first, a real pointer begins with GIT_LFS_VERSION_LINE.