Skip to content

Commit

Permalink
ident.c: treat $EMAIL as giving user.email identity explicitly
Browse files Browse the repository at this point in the history
The environment variable EMAIL has been honored since 28a94f8 (Fall back
to $EMAIL for missing GIT_AUTHOR_EMAIL and GIT_COMMITTER_EMAIL,
2007-04-28) as the end-user's wish to use the address as the identity.
When we use it, we should say we are explicitly given email by the user.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Jan 10, 2010
1 parent 91c38a2 commit 99178c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ident.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@ static void setup_ident(void)
if (!git_default_email[0]) {
const char *email = getenv("EMAIL");

if (email && email[0])
if (email && email[0]) {
strlcpy(git_default_email, email,
sizeof(git_default_email));
else {
user_ident_explicitly_given |= IDENT_MAIL_GIVEN;
} else {
if (!pw)
pw = getpwuid(getuid());
if (!pw)
Expand Down

0 comments on commit 99178c8

Please sign in to comment.