ident.c: treat $EMAIL as giving user.email identity explicitly
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>
Junio C Hamano committed
Jan 8, 2010 at 08:01 UTC
99178c831e72ba80b9edd5455b03070758c55526
1 file changed
+3
-2
ident.c
+3
-2
@@ -85,10 +85,11 @@ static void setup_ident(void)
85
if (!git_default_email[0]) {
86
const char *email = getenv("EMAIL");
87
88
- if (email && email[0])
88
+ if (email && email[0]) {
89
strlcpy(git_default_email, email,
90
sizeof(git_default_email));
91
- else {
91
+ user_ident_explicitly_given |= IDENT_MAIL_GIVEN;
92
+ } else {
93
if (!pw)
94
pw = getpwuid(getuid());
95
if (!pw)