libgit2

git_branch_upstream_remote

Version:

Retrieve the upstream remote of a local branch

This will return the currently configured "branch.*.remote" for a given branch. This branch must be local.

Signature

int git_branch_upstream_remote(git_buf *buf, git_repository *repo, const char *refname);

Parameters

In
buf

the buffer into which to write the name

In
repo

the repository in which to look

const char *
In
refname

the full name of the branch

Returns

int

0 or an error code

Versions