diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2018-09-17 14:49:46 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2018-09-17 14:49:46 +0200 |
commit | 12a1790d8e71087056d2b2de936ddae439e1d94c (patch) | |
tree | d1e5c5451afd9f0df3229e3b7ddcde7d97ffdaa0 | |
parent | 46f35127b6fcfab87cb80d1b772ac7c662eafd38 (diff) | |
download | libgit2-12a1790d8e71087056d2b2de936ddae439e1d94c.tar.gz |
revwalk: only check the first commit in the list for an earlier timestampcmn/revwalk-sign-regression
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.
-rw-r--r-- | src/revwalk.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/revwalk.c b/src/revwalk.c index d6c6fdb1b..4c5a1dabf 100644 --- a/src/revwalk.c +++ b/src/revwalk.c @@ -388,10 +388,16 @@ static int still_interesting(git_commit_list *list, int64_t time, int slop) if (!list) return 0; + /* + * If the destination list has commits with an earlier date than our + * source, we want to reset the slop counter as we're not done. + */ + if (time <= list->item->time) + return SLOP; + for (; list; list = list->next) { /* - * If the destination list has commits with an earlier date than - * our source or if it still contains interesting commits we + * If the destination list still contains interesting commits we * want to continue looking. */ if (!list->item->uninteresting || list->item->time > time) |