git-lfs-pointer 0.2.0

Parse and encode Git LFS pointer files
Documentation
  • Coverage
  • 34%
    17 out of 50 items documented1 out of 12 items with examples
  • Size
  • Source code size: 35.86 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 4.1 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 42s Average build duration of successful builds.
  • all releases: 27s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • rustutils/git-lfs
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • xfbs

git-lfs-pointer

Parse and encode Git LFS pointer files.

A pointer is a small UTF-8 text file that stands in for a large file in a git repo. It carries the file's SHA-256 OID, its size, and an optional list of extension records. This crate is a self-contained parser/encoder for that format — no I/O, no network, no git.

use git_lfs_pointer::{Oid, Pointer};

let oid: Oid = "4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393"
    .parse()
    .unwrap();
let pointer = Pointer::new(oid, 12345);

let encoded = pointer.encode();
let parsed = Pointer::parse(encoded.as_bytes()).unwrap();
assert_eq!(parsed.oid, oid);
assert_eq!(parsed.size, 12345);
assert!(parsed.canonical);

Part of the git-lfs Rust workspace. Experimental — not yet ready for production. License: MIT.