summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3023448)
raw | patch | inline | side by side (parent: 3023448)
author | Martin Koegler <mkoegler@auto.tuwien.ac.at> | |
Sun, 3 Feb 2008 21:22:37 +0000 (22:22 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 4 Feb 2008 00:04:56 +0000 (16:04 -0800) |
A zero commit date could be caused by:
* a missing author line
* a missing commiter line
* a malformed email address in the commiter line
* a malformed commit date
Simply reporting it as zero commit date is missleading.
Additionally, it upgrades the message to an error (instead of an printf).
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
* a missing author line
* a missing commiter line
* a malformed email address in the commiter line
* a malformed commit date
Simply reporting it as zero commit date is missleading.
Additionally, it upgrades the message to an error (instead of an printf).
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-fsck.c | patch | blob | history |
diff --git a/builtin-fsck.c b/builtin-fsck.c
index 2a6e94deaf6b27f27ad7655ebf6072a05b25017c..8c564345f411baeb1fb91e68ebc2f3be42c2f8af 100644 (file)
--- a/builtin-fsck.c
+++ b/builtin-fsck.c
fprintf(stderr, "Checking commit %s\n",
sha1_to_hex(commit->object.sha1));
+ if (!commit->date)
+ return objerror(&commit->object, "invalid author/committer line");
+
if (memcmp(buffer, "tree ", 5))
return objerror(&commit->object, "invalid format - expected 'tree' line");
if (get_sha1_hex(buffer+5, tree_sha1) || buffer[45] != '\n')
return objerror(&commit->object, "could not load commit's tree %s", tree_sha1);
if (!commit->parents && show_root)
printf("root %s\n", sha1_to_hex(commit->object.sha1));
- if (!commit->date)
- printf("bad commit date in %s\n",
- sha1_to_hex(commit->object.sha1));
return 0;
}