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
eaf18ac3
Commit
eaf18ac3
authored
Jun 20, 2012
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #777 from benstraub/revparse-fixup
Revparse fixup
parents
1d94a7d0
a15e7f86
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
src/revparse.c
+8
-8
tests-clar/refs/revparse.c
+3
-0
No files found.
src/revparse.c
View file @
eaf18ac3
...
...
@@ -323,10 +323,10 @@ static git_object* dereference_object(git_object *obj)
break
;
case
GIT_OBJ_TAG
:
{
git_object
*
newobj
=
NULL
;
if
(
0
==
git_tag_target
(
&
newobj
,
(
git_tag
*
)
obj
))
{
return
newobj
;
}
git_object
*
newobj
=
NULL
;
if
(
0
==
git_tag_target
(
&
newobj
,
(
git_tag
*
)
obj
))
{
return
newobj
;
}
}
break
;
...
...
@@ -506,8 +506,8 @@ static int handle_linear_syntax(git_object **out, git_object *obj, const char *m
/* "~" is the same as "~1" */
if
(
*
movement
==
'\0'
)
{
n
=
1
;
}
else
{
git__strtol32
(
&
n
,
movement
,
NULL
,
0
)
;
}
else
if
(
git__strtol32
(
&
n
,
movement
,
NULL
,
0
)
<
0
)
{
return
GIT_ERROR
;
}
commit1
=
(
git_commit
*
)
obj
;
...
...
@@ -581,7 +581,7 @@ static int handle_colon_syntax(git_object **out,
git_tree_free
(
tree
);
if
(
error
<
0
)
return
error
;
return
error
;
return
git_object_lookup
(
out
,
repo
,
&
oid
,
GIT_OBJ_ANY
);
}
...
...
@@ -623,7 +623,7 @@ static int revparse_global_grep(git_object **out, git_repository *repo, const ch
}
if
(
!
resultobj
)
{
giterr_set
(
GITERR_REFERENCE
,
"Couldn't find a match for %s"
,
pattern
);
git_object_free
(
walkobj
);
git_object_free
(
walkobj
);
}
else
{
*
out
=
resultobj
;
}
...
...
tests-clar/refs/revparse.c
View file @
eaf18ac3
...
...
@@ -104,6 +104,9 @@ void test_refs_revparse__to_type(void)
void
test_refs_revparse__linear_history
(
void
)
{
cl_git_fail
(
git_revparse_single
(
&
g_obj
,
g_repo
,
"foo~bar"
));
cl_git_fail
(
git_revparse_single
(
&
g_obj
,
g_repo
,
"master~bar"
));
test_object
(
"master~0"
,
"a65fedf39aefe402d3bb6e24df4d4f5fe4547750"
);
test_object
(
"master~1"
,
"be3563ae3f795b2b4353bcce3a527ad0a4f7f644"
);
test_object
(
"master~2"
,
"9fd738e8f7967c078dceed8190330fc8648ee56a"
);
...
...
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