summaryrefslogtreecommitdiff
path: root/fsck.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-07-02 21:34:54 -0700
committerJunio C Hamano <gitster@pobox.com>2009-07-06 09:36:16 -0700
commitf290974390c9be76e9166df6f0ab5ad790b812ac (patch)
tree4e6856e53e2eefd3e1fa1736377db59d48c66cdd /fsck.c
parentc8400d9ef57dc68925d93d0cb9f1777396b380e2 (diff)
downloadgit-f290974390c9be76e9166df6f0ab5ad790b812ac.tar.gz
Allow the Unix epoch to be a valid commit date
It is common practice to use the Unix epoch as a fallback date when a suitable date is not available. This is true of git svn and possibly other importing tools that import non-git history into git. Instead of clobbering established strtoul() error reporting semantics with our own, preserve the strtoul() error value of ULONG_MAX for fsck.c to handle. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fsck.c')
-rw-r--r--fsck.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fsck.c b/fsck.c
index 511b82cba9..89278c1459 100644
--- a/fsck.c
+++ b/fsck.c
@@ -229,7 +229,7 @@ static int fsck_commit(struct commit *commit, fsck_error error_func)
struct commit_graft *graft;
int parents = 0;
- if (!commit->date)
+ if (commit->date == ULONG_MAX)
return error_func(&commit->object, FSCK_ERROR, "invalid author/committer line");
if (memcmp(buffer, "tree ", 5))