commit: make it work with status.short
[gitweb.git] / builtin / blame.c
index 104a948e0c15361a0d62f85328a225d9ad9a0ec4..57a487e052fccc9ad45fa90a68a74fd54a1cdf72 100644 (file)
@@ -1375,10 +1375,15 @@ static void get_ac_line(const char *inbuf, const char *what,
        maillen = ident.mail_end - ident.mail_begin;
        mailbuf = ident.mail_begin;
 
-       *time = strtoul(ident.date_begin, NULL, 10);
+       if (ident.date_begin && ident.date_end)
+               *time = strtoul(ident.date_begin, NULL, 10);
+       else
+               *time = 0;
 
-       len = ident.tz_end - ident.tz_begin;
-       strbuf_add(tz, ident.tz_begin, len);
+       if (ident.tz_begin && ident.tz_end)
+               strbuf_add(tz, ident.tz_begin, ident.tz_end - ident.tz_begin);
+       else
+               strbuf_addstr(tz, "(unknown)");
 
        /*
         * Now, convert both name and e-mail using mailmap