Documentation
¶
Overview ¶
Package digest computes git-blob hashes for indexed files. It reads HEAD-tree and staging-index blob SHAs via go-git (no shelling out) and falls back to hashing working-tree bytes for dirty or untracked files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Source ¶
Source caches blob hashes for paths that go-git already knows about (tracked-and-clean files), avoiding rehashes during sync.
func Load ¶
Load opens the git repository rooted at root and prefetches blob hashes for the HEAD tree and the staging index. A non-git directory returns an empty Source (every file falls through to working-tree hashing).
func (*Source) For ¶
For returns the git-blob hash to record for path. It prefers the staged blob (covers "staged but committed body is different"), then the HEAD tree, and finally hashes the working-tree body in-process. body is only read when the cache misses, so callers can pass nil for clean files.