Skip to content

Commit 12a1790

Browse files
committed
revwalk: only check the first commit in the list for an earlier timestamp
This is not a big deal, but it does make us match git more closely by checking only the first. The lists are sorted already, so there should be no functional difference other than removing a possible check from every iteration in the loop.
1 parent 46f3512 commit 12a1790

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/revwalk.c

Lines changed: 8 additions & 2 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)

0 commit comments

Comments
 (0)