From 7d9599bd22521627b50527d394f1bb7c51252139 Mon Sep 17 00:00:00 2001 From: Dmitry Lobanov Date: Wed, 12 May 2021 10:30:12 +0300 Subject: branch: git branch upstream merge has been exposed. --- include/git2/branch.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/git2') diff --git a/include/git2/branch.h b/include/git2/branch.h index 0c0cc7ff7..24ea7f7d0 100644 --- a/include/git2/branch.h +++ b/include/git2/branch.h @@ -304,6 +304,19 @@ GIT_EXTERN(int) git_branch_remote_name( */ GIT_EXTERN(int) git_branch_upstream_remote(git_buf *buf, git_repository *repo, const char *refname); +/** + * Retrieve the upstream merge of a local branch + * + * This will return the currently configured "branch.*.merge" for a given + * branch. This branch must be local. + * + * @param buf the buffer into which to write the name + * @param repo the repository in which to look + * @param refname the full name of the branch + * @return 0 or an error code + */ + GIT_EXTERN(int) git_branch_upstream_merge(git_buf *buf, git_repository *repo, const char *refname); + /** * Determine whether a branch name is valid, meaning that (when prefixed * with `refs/heads/`) that it is a valid reference name, and that any -- cgit v1.2.1