From: Linus Torvalds Date: Sat, 23 Apr 2005 23:48:32 +0000 (-0700) Subject: Make a hack to convert-cache for missing author dates in old X-Git-Tag: v0.99~772 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=93256315b2444601a35484f4fb76cd5723284201;p=git.git Make a hack to convert-cache for missing author dates in old archives (notably the old sparse one). Very hacky. But hopefully we can do the conversion once, and never worry about this ever again. --- diff --git a/convert-cache.c b/convert-cache.c index 35191dff..312fb61c 100644 --- a/convert-cache.c +++ b/convert-cache.c @@ -233,6 +233,13 @@ static int convert_date_line(char *dst, void **buf, unsigned long *sp) return len + datelen; } + /* + * Hacky hacky: one of the sparse old-style commits does not have + * any date at all, but we can fake it by using the committer date. + */ + if (*date == '\n' && strchr(next, '>')) + date = strchr(next, '>')+2; + return len + sprintf(dst, "%lu -0700\n", parse_oldstyle_date(date)); }