Expand description
Git LFS pointer support with XET storage backend
This module provides complete LFS handling for git2db:
- Pointer parsing (spec-compliant, supports legacy hawser version)
- File loading with automatic pointer detection
- Worktree scanning and batch processing
- SHA256 validation (defense in depth against XET CAS bugs)
§Architecture
Application → git2db::lfs::LfsStorage → git2db::xet::XetStorage
→ git-xet-filter (XET only)§Example
ⓘ
use git2db::lfs::{LfsStorage, is_lfs_pointer};
// Initialize LFS storage
let config = git2db::XetConfig::default();
let storage = LfsStorage::new(&config).await?;
// Load file with automatic pointer detection
let data = storage.load_file(&path).await?;
// Or parse and smudge manually
if is_lfs_pointer(&content) {
let pointer = storage.parse_lfs_pointer(&content)?;
let data = storage.smudge_lfs_pointer(&pointer).await?;
}Structs§
- LfsPointer
- Parsed Git LFS pointer with spec-compliant fields
- LfsStorage
- Complete LFS storage operations
- Processing
Stats - Processing statistics for batch operations
Constants§
- XET_
MERKLE_ EXT_ KEY - Well-known LFS pointer extension key carrying the XET
MerkleHash(BLAKE3 keyed withDATA_KEYover the content-defined chunk DAG) for the blob, as a 64-char lowercase hex string. Per the LFS spec, unknown extension lines are ignored by vanilla git-lfs clients, so this rides the existingextensionsmap without breaking back-compat. See issue #386. - XET_
SHARD_ EXT_ KEY - Well-known LFS pointer extension key carrying an opaque shard/cas-location hint (e.g. a shard index or replication-group identifier) for the blob. Optional; consumed by smudge code that needs a locality hint beyond the Merkle hash.
Traits§
- LfsSmudge
- Extension trait for XetStorage - adds LFS capabilities
Functions§
- is_
lfs_ pointer - Check if content is a Git LFS pointer file