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
b8460c20
Commit
b8460c20
authored
Jul 06, 2012
by
nulltoken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revparse: do not segfault when retrieving the last entry
parent
e7279381
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletions
+2
-1
src/revparse.c
+1
-1
tests-clar/refs/revparse.c
+1
-0
No files found.
src/revparse.c
View file @
b8460c20
...
...
@@ -263,7 +263,7 @@ static int walk_ref_history(git_object **out, git_repository *repo, const char *
retcode
=
revparse_lookup_fully_qualifed_ref
(
out
,
repo
,
git_buf_cstr
(
&
buf
));
else
if
(
!
git_reflog_read
(
&
reflog
,
disambiguated
))
{
int
numentries
=
git_reflog_entrycount
(
reflog
);
if
(
numentries
<
n
)
{
if
(
numentries
<
n
+
1
)
{
giterr_set
(
GITERR_REFERENCE
,
"Reflog for '%s' has only %d entries, asked for %d"
,
git_buf_cstr
(
&
buf
),
numentries
,
n
);
retcode
=
GIT_ENOTFOUND
;
...
...
tests-clar/refs/revparse.c
View file @
b8460c20
...
...
@@ -156,6 +156,7 @@ void test_refs_revparse__ordinal(void)
test_object
(
"nope@{0}"
,
NULL
);
test_object
(
"master@{31415}"
,
NULL
);
test_object
(
"@{1000}"
,
NULL
);
test_object
(
"@{2}"
,
NULL
);
test_object
(
"@{0}"
,
"a65fedf39aefe402d3bb6e24df4d4f5fe4547750"
);
test_object
(
"@{1}"
,
"be3563ae3f795b2b4353bcce3a527ad0a4f7f644"
);
...
...
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