Skip to main content

index_state_from_exit

Function index_state_from_exit 

Source
pub fn index_state_from_exit(exit_code: Option<i32>) -> IndexVsHead
Expand description

What: Interpret the query’s exit status. Option<i32> is “an exit code, or nothing when a signal ended the process”; i32 is the platform’s exit-code integer type. Why: Only the two documented codes are answers; everything else is “Git cannot say”.

In TS you’d write (pseudocode):

return exitCode === 0 ? 'matches' : exitCode === 1 ? 'differs' : 'unknown';