From dfdd309e574df2da93f48d9cf4e83d53233dbe14 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 7 Feb 2006 13:19:10 -0800 Subject: [PATCH 1/2] 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 --- ident.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ident.c b/ident.c index 0461b8b2f8..23b8cfc600 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)); From 47e013f9207a235a87390ee8ad03c8a7406f4147 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 7 Feb 2006 15:35:46 -0800 Subject: [PATCH 2/2] t6000: fix a careless test library add-on. It tried to "restore" GIT_AUTHOR_EMAIL environment variable but the variable started out as unset, so ended up setting it to an empty string. This is now caught as an error. Signed-off-by: Junio C Hamano --- t/t6000lib.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/t/t6000lib.sh b/t/t6000lib.sh index 01f796e9c8..c6752af48e 100755 --- a/t/t6000lib.sh +++ b/t/t6000lib.sh @@ -51,7 +51,12 @@ as_author() export GIT_AUTHOR_EMAIL="$_author" "$@" - export GIT_AUTHOR_EMAIL="$_save" + if test -z "$_save" + then + unset GIT_AUTHOR_EMAIL + else + export GIT_AUTHOR_EMAIL="$_save" + fi } commit_date()