libgit2

git_reference_dwim

Version:

Lookup a reference by DWIMing its short name

Apply the git precendence rules to the given shorthand to determine which reference the user is refering to.

Signature

int git_reference_dwim(git_reference **out, git_repository *repo, const char *shorthand);

Parameters

In
out

pointer in which to store the reference

In
repo

the repository in which to look

const char *
In
shorthand

the short name for the reference

Returns

int

0 or an error code

Versions