Skip to main content

Module write_tree

Module write_tree 

Source
Expand description

Build tree objects from index entries (git write-tree core logic).

Functions§

build_cache_tree_from_index
Build a valid cache-tree extension from the index and write any missing tree objects.
build_cache_tree_from_tree
Build a cache-tree directly from a tree object, preserving Git’s raw entry_count semantics. Unlike build_cache_tree_from_index, the per-node entry_count is the recursive number of non-tree entries as recorded in the tree — duplicate path entries are counted separately, exactly as upstream Git’s cache-tree does after reading such a tree into the index.
verify_cache_tree
Walk a cache-tree against index, mirroring Git’s verify_one / cache_tree_verify.
write_tree_from_index
Build and write tree object(s) from index entries and return the tree OID.
write_tree_from_index_subset
Build and write tree object(s) from index entries and return the tree OID.
write_tree_partial_from_index
Build a tree for a partial commit: paths listed in paths_from_index (repository-relative, UTF-8 path bytes) are taken from index; every other path is copied from base_tree_oid (typically HEAD^{tree}).