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
c1634611
Commit
c1634611
authored
Feb 14, 2023
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revparse: comment reflog HEAD@{n} parsing
parent
0628e25d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
src/libgit2/revparse.c
+10
-5
No files found.
src/libgit2/revparse.c
View file @
c1634611
...
...
@@ -268,11 +268,16 @@ static int retrieve_revobject_from_reflog(git_object **out, git_reference **base
int
error
=
-
1
;
if
(
*
base_ref
==
NULL
)
{
if
(
position
>
0
&&
(
!
strcmp
(
identifier
,
"HEAD"
)))
{
if
((
error
=
git_reference_lookup
(
&
ref
,
repo
,
"HEAD"
))
<
0
)
return
error
;
}
else
if
((
error
=
git_reference_dwim
(
&
ref
,
repo
,
identifier
))
<
0
)
/*
* When HEAD@{n} is specified, do not use dwim, which would resolve the
* reference (to the current branch that HEAD is pointing to).
*/
if
(
position
>
0
&&
strcmp
(
identifier
,
GIT_HEAD_FILE
)
==
0
)
error
=
git_reference_lookup
(
&
ref
,
repo
,
GIT_HEAD_FILE
);
else
error
=
git_reference_dwim
(
&
ref
,
repo
,
identifier
);
if
(
error
<
0
)
return
error
;
}
else
{
ref
=
*
base_ref
;
...
...
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