Skip to content

Commit e181a64

Browse files
authored
Merge pull request libgit2#4809 from libgit2/cmn/revwalk-sign-regression
Fix revwalk limiting regression
2 parents 744d838 + 12a1790 commit e181a64

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/revwalk.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,10 +388,16 @@ static int still_interesting(git_commit_list *list, int64_t time, int slop)
388388
if (!list)
389389
return 0;
390390

391+
/*
392+
* If the destination list has commits with an earlier date than our
393+
* source, we want to reset the slop counter as we're not done.
394+
*/
395+
if (time <= list->item->time)
396+
return SLOP;
397+
391398
for (; list; list = list->next) {
392399
/*
393-
* If the destination list has commits with an earlier date than
394-
* our source or if it still contains interesting commits we
400+
* If the destination list still contains interesting commits we
395401
* want to continue looking.
396402
*/
397403
if (!list->item->uninteresting || list->item->time > time)
@@ -405,7 +411,7 @@ static int still_interesting(git_commit_list *list, int64_t time, int slop)
405411
static int limit_list(git_commit_list **out, git_revwalk *walk, git_commit_list *commits)
406412
{
407413
int error, slop = SLOP;
408-
int64_t time = ~0ll;
414+
int64_t time = INT64_MAX;
409415
git_commit_list *list = commits;
410416
git_commit_list *newlist = NULL;
411417
git_commit_list **p = &newlist;

0 commit comments

Comments
 (0)