Skip to main content

Module git_refs

Module git_refs 

Source
Expand description

Base-ref selection — a faithful port of git-refs.ts.

Constants§

EMPTY_TREE_REF
The well-known git empty-tree object id. Used as the diff base for a parentless (first) commit, so its full content shows up as additions.

Functions§

base_ref_for_commit_parents
The diff base for a commit given its space-separated parent hashes: the first parent for normal and merge commits, or the empty tree when there are no parents. The _hash arg is unused (parity with the original).
base_ref_for_parents
The diff base for a commit given its structured parent hashes: the first parent, or the empty tree when parentless. Prefer this over base_ref_for_commit_parents when the parents are already a slice — it avoids a join/split round-trip. The string variant remains the port shim for the CLI-output path that receives space-separated parents.