diff options
author | Carlos MartÃn Nieto <cmn@dwim.me> | 2018-09-17 14:39:58 +0200 |
---|---|---|
committer | Patrick Steinhardt <ps@pks.im> | 2018-10-26 14:58:51 +0200 |
commit | 3cabf8d15e00d7d71aa4df01af07d0dbc974afe9 (patch) | |
tree | c07318e6e8989b7d331dd56fc809bc93d5cec95d | |
parent | b133ab9be9b8314e48585e5026698cd8a533bbcd (diff) | |
download | libgit2-3cabf8d15e00d7d71aa4df01af07d0dbc974afe9.tar.gz |
revwalk: use the max value for a signed integer
When porting, we overlooked that the difference between git's and our's time
representation and copied their way of getting the max value.
Unfortunately git was using unsigned integers, so `~0ll` does correspond to
their max value, whereas for us it corresponds to `-1`. This means that we
always consider the last date to be smaller than the current commit's and always
think commits are interesting.
Change the initial value to the macro that gives us the maximum value on each
platform so we can accurately consider commits interesting or not.
(cherry picked from commit 46f35127b6fcfab87cb80d1b772ac7c662eafd38)
-rw-r--r-- | src/revwalk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/revwalk.c b/src/revwalk.c index 290313a3b..7f50e9cd8 100644 --- a/src/revwalk.c +++ b/src/revwalk.c @@ -401,7 +401,7 @@ static int still_interesting(git_commit_list *list, int64_t time, int slop) static int limit_list(git_commit_list **out, git_revwalk *walk, git_commit_list *commits) { int error, slop = SLOP; - int64_t time = ~0ll; + int64_t time = INT64_MAX; git_commit_list *list = commits; git_commit_list *newlist = NULL; git_commit_list **p = &newlist; |