summaryrefslogtreecommitdiff
path: root/ident.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-02-07 21:19:10 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-02-09 05:55:34 (GMT)
commitdfdd309e574df2da93f48d9cf4e83d53233dbe14 (patch)
tree0cfb167703d01abee0098d87b68715f3a51c81ca /ident.c
parentd19e06fa8f86b611c10115903ef7e50d5de112f0 (diff)
downloadgit-dfdd309e574df2da93f48d9cf4e83d53233dbe14.zip
git-dfdd309e574df2da93f48d9cf4e83d53233dbe14.tar.gz
git-dfdd309e574df2da93f48d9cf4e83d53233dbe14.tar.bz2
Do not allow empty name or email.
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>
Diffstat (limited to 'ident.c')
-rw-r--r--ident.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ident.c b/ident.c
index 0461b8b..23b8cfc 100644
--- a/ident.c
+++ b/ident.c
@@ -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));