Skip to main content

head_commit

Function head_commit 

Source
pub fn head_commit(
    git_dir: &Path,
    common_dir: &Path,
    format: ObjectFormat,
) -> Option<String>
Expand description

What: The commit HEAD resolves to, read from the plain ref files. Why: An unusual ref storage answers “unknown”, which declines the shortcut rather than guessing.

In TS you’d write (pseudocode):

function headCommit(gitDir: string, commonDir: string, format: ObjectFormat): string | undefined;