summaryrefslogtreecommitdiff
path: root/ident.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-01-08 08:01:10 -0800
committerJunio C Hamano <gitster@pobox.com>2010-01-10 09:43:22 -0800
commit99178c831e72ba80b9edd5455b03070758c55526 (patch)
tree25436520513d38e79a1ee2ecd0472493be1bf56c /ident.c
parent91c38a21089c4b30d35f392386c752a017ac6db0 (diff)
downloadgit-99178c831e72ba80b9edd5455b03070758c55526.tar.gz
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>
Diffstat (limited to 'ident.c')
-rw-r--r--ident.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ident.c b/ident.c
index e67c5ad1e8..d4f614543d 100644
--- a/ident.c
+++ b/ident.c
@@ -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)