]> git.ipfire.org Git - thirdparty/git.git/commitdiff
commit: use timestamp_t for author_date_slab
authorDerrick Stolee <dstolee@microsoft.com>
Tue, 21 Aug 2018 20:54:12 +0000 (20:54 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 21 Aug 2018 21:08:18 +0000 (14:08 -0700)
The author_date_slab is used to store the author date of a commit
when walking with the --author-date flag in rev-list or log. This
was added as an 'unsigned long' in

81c6b38b "log: --author-date-order"

Since 'unsigned long' is ambiguous in its bit-ness across platforms
(64-bit in Linux, 32-bit in Windows, for example), most references
to the author dates in commit.c were converted to timestamp_t in

dddbad72 "timestamp_t: a new data type for timestamps"

However, the slab definition was missed, leading to a mismatch in
the data types in Windows. This would not reveal itself as a bug
unless someone authors a commit after February 2106, but commits
can store anything as their author date.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit.c

index 99a62b90ee29280d9fb455d2907bb6885ca0fab6..801b6dc11fd493c66c91282481c9cd8494c7631b 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -588,7 +588,7 @@ struct commit *pop_commit(struct commit_list **stack)
 define_commit_slab(indegree_slab, int);
 
 /* record author-date for each commit object */
-define_commit_slab(author_date_slab, unsigned long);
+define_commit_slab(author_date_slab, timestamp_t);
 
 static void record_author_date(struct author_date_slab *author_date,
                               struct commit *commit)