git_branch_remote_name

Find the remote name of a remote-tracking branch

This will return the name of the remote whose fetch refspec is matching the given branch. E.g. given a branch "refs/remotes/test/master", it will extract the "test" part. If refspecs from multiple remotes match, the function will return GIT_EAMBIGUOUS.

extern (C) nothrow @nogc
int
git_branch_remote_name

Parameters

out_ libgit2_d.buffer.git_buf*

The buffer into which the name will be written.

repo libgit2_d.types.git_repository*

The repository where the branch lives.

refname const(char)*

complete name of the remote tracking branch.

Return Value

Type: int

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

Meta