1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! Tree snapshots of uncommitted state (ADR 0017): the index and the worktree
//! as plain tree oids, so the rest of the pipeline — diff-tree enumeration,
//! the invariants, blob reads — runs on them unchanged.
//!
//! Plumbing only, and never the user's index: a temporary `GIT_INDEX_FILE` is
//! seeded from `ls-files -s -z` piped into `update-index -z --index-info`.
//! Snapshot blobs land in the odb (unreferenced, gc-able), which pins the
//! content so later `cat-file` reads by `<tree>:<path>` always resolve.
use crateEngineError;
use crate;
/// Tree oid of the current index (the staged state). The user's index file is
/// never written to.
/// Tree oid of the worktree: every tracked file's current content plus
/// untracked-but-not-ignored files, with worktree deletions honoured.
/// Whether a worktree snapshot would differ from `HEAD` at all.
///
/// The question a reviewer surface actually has: "is offering to include
/// uncommitted work going to change anything?" Answered with two cheap
/// plumbing calls rather than by building the snapshot and comparing trees —
/// the snapshot re-hashes every tracked file, which is precisely the work a
/// clean answer lets the caller skip.