Skip to content

Commit

Permalink
Do not allow empty name or email.
Browse files Browse the repository at this point in the history
Instead of silently allowing to create a bogus commit that lacks
information by mistake, complain loudly and die.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Feb 9, 2006
1 parent d19e06f commit dfdd309
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ident.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ static const char *get_ident(const char *name, const char *email,
name = git_default_name;
if (!email)
email = git_default_email;

if (!*name || !*email)
die("empty ident %s <%s> not allowed",
name, email);

strcpy(date, git_default_date);
if (date_str)
parse_date(date_str, date, sizeof(date));
Expand Down

0 comments on commit dfdd309

Please sign in to comment.