Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
7d9599bd
Commit
7d9599bd
authored
May 12, 2021
by
Dmitry Lobanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branch: git branch upstream merge has been exposed.
parent
a2d953e5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
include/git2/branch.h
+13
-0
src/branch.c
+8
-0
No files found.
include/git2/branch.h
View file @
7d9599bd
...
...
@@ -305,6 +305,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
* additional branch name restrictions are imposed (eg, it cannot start
...
...
src/branch.c
View file @
7d9599bd
...
...
@@ -492,6 +492,14 @@ static int git_branch_upstream_with_format(git_buf *buf, git_repository *repo, c
return
error
;
}
int
git_branch_upstream_remote
(
git_buf
*
buf
,
git_repository
*
repo
,
const
char
*
refname
)
{
git_branch_upstream_with_format
(
buf
,
repo
,
refname
,
"branch.%s.remote"
);
}
int
git_branch_upstream_merge
(
git_buf
*
buf
,
git_repository
*
repo
,
const
char
*
refname
)
{
git_branch_upstream_with_format
(
buf
,
repo
,
refname
,
"branch.%s.merge"
);
}
int
git_branch_remote_name
(
git_buf
*
buf
,
git_repository
*
repo
,
const
char
*
refname
)
{
git_strarray
remote_list
=
{
0
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment