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
c5d8e300
Unverified
Commit
c5d8e300
authored
Feb 21, 2019
by
Augustin Fabre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branch: have git_branch_lookup accept GIT_BRANCH_ALL
parent
0a25141e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
src/branch.c
+16
-2
No files found.
src/branch.c
View file @
c5d8e300
...
@@ -22,7 +22,7 @@ static int retrieve_branch_reference(
...
@@ -22,7 +22,7 @@ static int retrieve_branch_reference(
git_reference
**
branch_reference_out
,
git_reference
**
branch_reference_out
,
git_repository
*
repo
,
git_repository
*
repo
,
const
char
*
branch_name
,
const
char
*
branch_name
,
int
is_remote
)
bool
is_remote
)
{
{
git_reference
*
branch
=
NULL
;
git_reference
*
branch
=
NULL
;
int
error
=
0
;
int
error
=
0
;
...
@@ -334,9 +334,23 @@ int git_branch_lookup(
...
@@ -334,9 +334,23 @@ int git_branch_lookup(
const
char
*
branch_name
,
const
char
*
branch_name
,
git_branch_t
branch_type
)
git_branch_t
branch_type
)
{
{
int
error
=
-
1
;
assert
(
ref_out
&&
repo
&&
branch_name
);
assert
(
ref_out
&&
repo
&&
branch_name
);
return
retrieve_branch_reference
(
ref_out
,
repo
,
branch_name
,
branch_type
==
GIT_BRANCH_REMOTE
);
switch
(
branch_type
)
{
case
GIT_BRANCH_LOCAL
:
case
GIT_BRANCH_REMOTE
:
error
=
retrieve_branch_reference
(
ref_out
,
repo
,
branch_name
,
branch_type
==
GIT_BRANCH_REMOTE
);
break
;
case
GIT_BRANCH_ALL
:
error
=
retrieve_branch_reference
(
ref_out
,
repo
,
branch_name
,
false
);
if
(
error
==
GIT_ENOTFOUND
)
error
=
retrieve_branch_reference
(
ref_out
,
repo
,
branch_name
,
true
);
break
;
default:
assert
(
false
);
}
return
error
;
}
}
int
git_branch_name
(
int
git_branch_name
(
...
...
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