Expand description
Build the final tree from applied hunks, via plumbing against a temporary index (ADR 0011). No checkout, no touching the user’s index or worktree.
Text file content is always computed BY APPLYING HUNKS — never by copying
head blobs — so tree equality against head^{tree} is a real assertion
(invariant 3). The two exceptions, both explicit here: binary files are
staged from the recorded head oid (they carry no hunks; documented
tautology), and submodules are staged as gitlinks from the pseudo-hunk’s
commit id.
Functions§
- build_
tree - Stage every file’s final state on top of
baseand return the written tree.