summaryrefslogtreecommitdiff
path: root/src/commit_list.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-10-14 16:49:01 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-10-14 16:54:13 +0200
commit5ffdea6f65bb105c17a1c4730d51732e3391bf63 (patch)
tree84076a2c3b345128dd3b31db2fdcf443d47fdb62 /src/commit_list.c
parentd8dc2b8f54cdf7d707c6a552175dc0d619dc230e (diff)
downloadlibgit2-cmn/quick-parse-64.tar.gz
revwalk: make commit list use 64 bits for timecmn/quick-parse-64
We moved the "main" parsing to use 64 bits for the timestamp, but the quick parsing for the revwalk did not. This means that for large timestamps we fail to parse the time and thus the walk. Move this parser to use 64 bits as well.
Diffstat (limited to 'src/commit_list.c')
-rw-r--r--src/commit_list.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/commit_list.c b/src/commit_list.c
index 3054c18dd..53612d514 100644
--- a/src/commit_list.c
+++ b/src/commit_list.c
@@ -110,7 +110,7 @@ static int commit_quick_parse(
const uint8_t *buffer_end = buffer + buffer_len;
const uint8_t *parents_start, *committer_start;
int i, parents = 0;
- int commit_time;
+ int64_t commit_time;
buffer += strlen("tree ") + GIT_OID_HEXSZ + 1;
@@ -166,10 +166,10 @@ static int commit_quick_parse(
buffer--;
}
- if ((buffer == committer_start) || (git__strtol32(&commit_time, (char *)(buffer + 1), NULL, 10) < 0))
+ if ((buffer == committer_start) || (git__strtol64(&commit_time, (char *)(buffer + 1), NULL, 10) < 0))
return commit_error(commit, "cannot parse commit time");
- commit->time = (time_t)commit_time;
+ commit->time = commit_time;
commit->parsed = 1;
return 0;
}