Skip to content

Commit

Permalink
Merge branch 'jc/empty-commit'
Browse files Browse the repository at this point in the history
* jc/empty-commit:
  t6000: fix a careless test library add-on.
  Do not allow empty name or email.
  • Loading branch information
Junio C Hamano committed Feb 10, 2006
2 parents cf7bb58 + 47e013f commit 4d44cb1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
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
7 changes: 6 additions & 1 deletion t/t6000lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 4d44cb1

Please sign in to comment.