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
8d453f16
Commit
8d453f16
authored
Jul 27, 2021
by
lhchavez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Swap the order of the `git_graph_reachable_from_any` params
len, array -> array, len
parent
ce5400cd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
include/git2/graph.h
+2
-2
src/graph.c
+3
-3
tests/graph/reachable_from_any.c
+6
-6
No files found.
include/git2/graph.h
View file @
8d453f16
...
...
@@ -68,8 +68,8 @@ GIT_EXTERN(int) git_graph_descendant_of(
GIT_EXTERN
(
int
)
git_graph_reachable_from_any
(
git_repository
*
repo
,
const
git_oid
*
commit
,
size_t
length
,
const
git_oid
descendant_array
[]
);
const
git_oid
descendant_array
[]
,
size_t
length
);
/** @} */
GIT_END_DECL
...
...
src/graph.c
View file @
8d453f16
...
...
@@ -179,14 +179,14 @@ int git_graph_descendant_of(git_repository *repo, const git_oid *commit, const g
if
(
git_oid_equal
(
commit
,
ancestor
))
return
0
;
return
git_graph_reachable_from_any
(
repo
,
ancestor
,
1
,
commit
);
return
git_graph_reachable_from_any
(
repo
,
ancestor
,
commit
,
1
);
}
int
git_graph_reachable_from_any
(
git_repository
*
repo
,
const
git_oid
*
commit_id
,
size_t
length
,
const
git_oid
descendant_array
[]
)
const
git_oid
descendant_array
[]
,
size_t
length
)
{
git_revwalk
*
walk
=
NULL
;
git_vector
list
;
...
...
tests/graph/reachable_from_any.c
View file @
8d453f16
...
...
@@ -45,11 +45,11 @@ void test_graph_reachable_from_any__returns_correct_result(void)
cl_assert_equal_i
(
git_graph_reachable_from_any
(
repo
,
git_object_id
(
branchH1
),
1
,
git_object_id
(
branchA1
)
),
repo
,
git_object_id
(
branchH1
),
git_object_id
(
branchA1
),
1
),
0
);
cl_assert_equal_i
(
git_graph_reachable_from_any
(
repo
,
git_object_id
(
branchH1
),
1
,
git_object_id
(
branchA2
)
),
repo
,
git_object_id
(
branchH1
),
git_object_id
(
branchA2
),
1
),
0
);
cl_git_pass
(
git_oid_cpy
(
&
descendants
[
0
],
git_object_id
(
branchA1
)));
...
...
@@ -60,10 +60,10 @@ void test_graph_reachable_from_any__returns_correct_result(void)
cl_git_pass
(
git_oid_cpy
(
&
descendants
[
5
],
git_object_id
(
branchC2
)));
cl_git_pass
(
git_oid_cpy
(
&
descendants
[
6
],
git_object_id
(
branchH2
)));
cl_assert_equal_i
(
git_graph_reachable_from_any
(
repo
,
git_object_id
(
branchH2
),
6
,
descendants
),
git_graph_reachable_from_any
(
repo
,
git_object_id
(
branchH2
),
descendants
,
6
),
0
);
cl_assert_equal_i
(
git_graph_reachable_from_any
(
repo
,
git_object_id
(
branchH2
),
7
,
descendants
),
git_graph_reachable_from_any
(
repo
,
git_object_id
(
branchH2
),
descendants
,
7
),
1
);
git_object_free
(
branchA1
);
...
...
@@ -197,8 +197,8 @@ void test_graph_reachable_from_any__exhaustive(void)
actual_reachable
=
git_graph_reachable_from_any
(
repo
,
git_commit_id
(
parent_commit
),
n_
descendants
,
descendants
);
descendants
,
n_
descendants
);
if
(
actual_reachable
!=
expected_reachable
)
{
git_buf
error_message_buf
=
GIT_BUF_INIT
;
char
parent_oidbuf
[
9
]
=
{
0
},
child_oidbuf
[
9
]
=
{
0
};
...
...
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