Skip to main content

head_mode

Function head_mode 

Source
pub fn head_mode(
    head: Option<&Entry>,
    index: &Entry,
) -> Result<CandidateMode, &'static str>
Expand description

What: HEAD’s mode for the file, or why HEAD and the index rule it out. index is the private index’s entry, whose object the correction was computed against; for a file the fix did not select it equals the real index’s entry. Why: HEAD must hold the same object as an ordinary file; the index must then hold it with HEAD’s mode. The mode is what the worktree copy is checked against next.

In TS you’d write (pseudocode):

function headMode(head: Entry | undefined, index: Entry): CandidateMode; // throws the reason