Move write_shallow_commits to fetch-pack.c
[gitweb.git] / ident.c
diff --git a/ident.c b/ident.c
index 770b9e02c823dd80b89df2d8a83b975238126fcb..35a6f264737e700ddd45714a0e966422a0d756c7 100644 (file)
--- a/ident.c
+++ b/ident.c
@@ -224,8 +224,10 @@ const char *fmt_ident(const char *name, const char *email,
        }
 
        strcpy(date, git_default_date);
-       if (!name_addr_only && date_str)
-               parse_date(date_str, date, sizeof(date));
+       if (!name_addr_only && date_str && date_str[0]) {
+               if (parse_date(date_str, date, sizeof(date)) < 0)
+                       die("invalid date format: %s", date_str);
+       }
 
        i = copy(buffer, sizeof(buffer), 0, name);
        i = add_raw(buffer, sizeof(buffer), i, " <");