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
b0401c68
Commit
b0401c68
authored
Jun 25, 2013
by
Russell Belfer
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1681 from arthurschreiber/patch-1
Prefer younger merge bases over older ones.
parents
d0c36a0b
24ba6d3f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletions
+13
-1
src/commit_list.c
+1
-1
tests-clar/revwalk/mergebase.c
+12
-0
No files found.
src/commit_list.c
View file @
b0401c68
...
...
@@ -36,7 +36,7 @@ git_commit_list *git_commit_list_insert_by_date(git_commit_list_node *item, git_
git_commit_list
*
p
;
while
((
p
=
*
pp
)
!=
NULL
)
{
if
(
git_commit_list_time_cmp
(
p
->
item
,
item
)
<
0
)
if
(
git_commit_list_time_cmp
(
p
->
item
,
item
)
>
0
)
break
;
pp
=
&
p
->
next
;
...
...
tests-clar/revwalk/mergebase.c
View file @
b0401c68
...
...
@@ -123,6 +123,18 @@ void test_revwalk_mergebase__no_common_ancestor_returns_ENOTFOUND(void)
cl_assert_equal_sz
(
4
,
behind
);
}
void
test_revwalk_mergebase__prefer_youngest_merge_base
(
void
)
{
git_oid
result
,
one
,
two
,
expected
;
cl_git_pass
(
git_oid_fromstr
(
&
one
,
"a4a7dce85cf63874e984719f4fdd239f5145052f "
));
cl_git_pass
(
git_oid_fromstr
(
&
two
,
"be3563ae3f795b2b4353bcce3a527ad0a4f7f644"
));
cl_git_pass
(
git_oid_fromstr
(
&
expected
,
"c47800c7266a2be04c571c04d5a6614691ea99bd"
));
cl_git_pass
(
git_merge_base
(
&
result
,
_repo
,
&
one
,
&
two
));
cl_assert
(
git_oid_cmp
(
&
result
,
&
expected
)
==
0
);
}
void
test_revwalk_mergebase__no_off_by_one_missing
(
void
)
{
git_oid
result
,
one
,
two
;
...
...
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