summaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2017-04-21 10:45:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-04-24 03:19:15 (GMT)
commitcb71f8bdb5a105cd5b66142b887989d9addc82d0 (patch)
treee5d673bfdd396ebfc6fb0957a86dd532c25e995b /refs
parent1aeb7e756c82d31e46712ec7557c4cbae37dccd9 (diff)
downloadgit-cb71f8bdb5a105cd5b66142b887989d9addc82d0.zip
git-cb71f8bdb5a105cd5b66142b887989d9addc82d0.tar.gz
git-cb71f8bdb5a105cd5b66142b887989d9addc82d0.tar.bz2
PRItime: introduce a new "printf format" for timestamps
Currently, Git's source code treats all timestamps as if they were unsigned longs. Therefore, it is okay to write "%lu" when printing them. There is a substantial problem with that, though: at least on Windows, time_t is *larger* than unsigned long, and hence we will want to switch away from the ill-specified `unsigned long` data type. So let's introduce the pseudo format "PRItime" (currently simply being defined to "lu") to make it easier to change the data type used for timestamps. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs')
-rw-r--r--refs/files-backend.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index dae0522..ecbb13d 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -4131,7 +4131,7 @@ static int expire_reflog_ent(struct object_id *ooid, struct object_id *noid,
printf("prune %s", message);
} else {
if (cb->newlog) {
- fprintf(cb->newlog, "%s %s %s %lu %+05d\t%s",
+ fprintf(cb->newlog, "%s %s %s %"PRItime" %+05d\t%s",
oid_to_hex(ooid), oid_to_hex(noid),
email, timestamp, tz, message);
oidcpy(&cb->last_kept_oid, noid);