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>
This commit is contained in:

committed by
Junio C Hamano

parent
c8400d9ef5
commit
f290974390
2
fsck.c
2
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))
|
||||
|
Reference in New Issue
Block a user