libgit2

git_branch_remote_name

Version:

Return the name of remote that the remote tracking branch belongs to.

Signature

int git_branch_remote_name(git_buf *out, git_repository *repo, const char *canonical_branch_name);

Parameters

In
out

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

In
repo

The repository where the branch lives.

const char *
In
canonical_branch_name

name of the remote tracking branch.

Returns

int

0, GIT_ENOTFOUND when no remote matching remote was found, GIT_EAMBIGUOUS when the branch maps to several remotes, otherwise an error code.

Versions