libgit2

git_branch_remote_name

Version:

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

Signature

int git_branch_remote_name(char *remote_name_out, size_t buffer_size, git_repository *repo, const char *canonical_branch_name);

Parameters

char *
In
remote_name_out

The user-allocated buffer which will be filled with the name of the remote. Pass NULL if you just want to get the needed size of the name of the remote as the output value.

size_t
In
buffer_size

Size of the out buffer in bytes.

In
repo

The repository where the branch lives.

const char *
In
canonical_branch_name

name of the remote tracking branch.

Returns

int

Number of characters in the reference name including the trailing NUL byte; GIT_ENOTFOUND when no remote matching remote was gound, GIT_EAMBIGUOUS when the branch maps to several remotes, otherwise an error code.

Versions