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
c11c08a5
Commit
c11c08a5
authored
Mar 09, 2017
by
Adam Niedzielski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip uninteresting commits in revwalk timesort iterator
Fixes #4099
parent
b31b2360
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
+26
-3
src/revwalk.c
+6
-3
tests/revwalk/basic.c
+20
-0
No files found.
src/revwalk.c
View file @
c11c08a5
...
...
@@ -231,9 +231,12 @@ static int revwalk_next_timesort(git_commit_list_node **object_out, git_revwalk
{
git_commit_list_node
*
next
;
if
((
next
=
git_pqueue_pop
(
&
walk
->
iterator_time
))
!=
NULL
)
{
*
object_out
=
next
;
return
0
;
while
((
next
=
git_pqueue_pop
(
&
walk
->
iterator_time
))
!=
NULL
)
{
/* Some commits might become uninteresting after being added to the list */
if
(
!
next
->
uninteresting
)
{
*
object_out
=
next
;
return
0
;
}
}
giterr_clear
();
...
...
tests/revwalk/basic.c
View file @
c11c08a5
...
...
@@ -345,6 +345,26 @@ void test_revwalk_basic__topo_crash(void)
git_revwalk_next
(
&
oid
,
_walk
);
}
void
test_revwalk_basic__from_new_to_old
(
void
)
{
git_oid
from_oid
,
to_oid
,
oid
;
int
i
=
0
;
revwalk_basic_setup_walk
(
NULL
);
git_revwalk_sorting
(
_walk
,
GIT_SORT_TIME
);
cl_git_pass
(
git_oid_fromstr
(
&
to_oid
,
"5b5b025afb0b4c913b4c338a42934a3863bf3644"
));
cl_git_pass
(
git_oid_fromstr
(
&
from_oid
,
"a4a7dce85cf63874e984719f4fdd239f5145052f"
));
cl_git_pass
(
git_revwalk_push
(
_walk
,
&
to_oid
));
cl_git_pass
(
git_revwalk_hide
(
_walk
,
&
from_oid
));
while
(
git_revwalk_next
(
&
oid
,
_walk
)
==
0
)
i
++
;
cl_assert_equal_i
(
i
,
0
);
}
void
test_revwalk_basic__push_range
(
void
)
{
revwalk_basic_setup_walk
(
NULL
);
...
...
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