libgit2

git_branch_upstream_name

Version:

Return the name of the reference supporting the remote tracking branch, given the name of a local branch reference.

Signature

int git_branch_upstream_name(git_buf *out, git_repository *repo, const char *refname);

Parameters

In
out

Pointer to the user-allocated git_buf which will be filled with the name of the reference.

In
repo

the repository where the branches live

const char *
In
refname

reference name of the local branch.

Returns

int

0, GIT_ENOTFOUND when no remote tracking reference exists, otherwise an error code.

Versions