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
46c2ead0
Commit
46c2ead0
authored
May 10, 2012
by
Ben Straub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now properly handling branches with "-g" in their names.
parent
ec6a632a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
3 deletions
+5
-3
src/revparse.c
+3
-3
tests-clar/refs/revparse.c
+1
-0
tests/resources/testrepo.git/refs/heads/not-good
+1
-0
No files found.
src/revparse.c
View file @
46c2ead0
...
...
@@ -56,9 +56,9 @@ static int revparse_lookup_object(git_object **out, git_repository *repo, const
/* "git describe" output; snip everything before/including "-g" */
substr
=
strstr
(
spec
,
"-g"
);
if
(
substr
)
{
spec
=
substr
+
2
;
speclen
=
strlen
(
spec
)
;
if
(
substr
&&
!
revparse_lookup_object
(
out
,
repo
,
substr
+
2
))
{
return
0
;
}
/* SHA or prefix */
...
...
tests-clar/refs/revparse.c
View file @
46c2ead0
...
...
@@ -66,6 +66,7 @@ void test_refs_revparse__partial_refs(void)
void
test_refs_revparse__describe_output
(
void
)
{
test_object
(
"blah-7-gc47800c"
,
"c47800c7266a2be04c571c04d5a6614691ea99bd"
);
test_object
(
"not-good"
,
"a65fedf39aefe402d3bb6e24df4d4f5fe4547750"
);
}
void
test_refs_revparse__nth_parent
(
void
)
...
...
tests/resources/testrepo.git/refs/heads/not-good
0 → 100644
View file @
46c2ead0
a65fedf39aefe402d3bb6e24df4d4f5fe4547750
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