Skip to main content

Module tree

Module tree 

Source
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 base and return the written tree.