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
2d012c0c
Commit
2d012c0c
authored
Jul 11, 2012
by
nulltoken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revparse: deploy git_commit_nth_gen_ancestor()
parent
b1aca6ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
21 deletions
+2
-21
src/revparse.c
+2
-21
No files found.
src/revparse.c
View file @
2d012c0c
...
...
@@ -522,8 +522,7 @@ static int handle_caret_syntax(git_object **out, git_repository *repo, git_objec
static
int
handle_linear_syntax
(
git_object
**
out
,
git_object
*
obj
,
const
char
*
movement
)
{
git_commit
*
commit1
,
*
commit2
;
int
i
,
n
;
int
n
;
/* Dereference until we reach a commit. */
if
(
dereference_to_type
(
&
obj
,
obj
,
GIT_OBJ_COMMIT
)
<
0
)
{
...
...
@@ -537,26 +536,8 @@ static int handle_linear_syntax(git_object **out, git_object *obj, const char *m
}
else
if
(
git__strtol32
(
&
n
,
movement
,
NULL
,
0
)
<
0
)
{
return
GIT_ERROR
;
}
commit1
=
(
git_commit
*
)
obj
;
/* "~0" just returns the input */
if
(
n
==
0
)
{
*
out
=
obj
;
return
0
;
}
for
(
i
=
0
;
i
<
n
;
i
++
)
{
if
(
git_commit_parent
(
&
commit2
,
commit1
,
0
)
<
0
)
{
return
GIT_ERROR
;
}
if
(
commit1
!=
(
git_commit
*
)
obj
)
{
git_commit_free
(
commit1
);
}
commit1
=
commit2
;
}
*
out
=
(
git_object
*
)
commit1
;
return
0
;
return
git_commit_nth_gen_ancestor
((
git_commit
**
)
out
,
(
git_commit
*
)
obj
,
n
);
}
static
int
oid_for_tree_path
(
git_oid
*
out
,
git_tree
*
tree
,
git_repository
*
repo
,
const
char
*
path
)
...
...
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