summaryrefslogtreecommitdiff
path: root/ident.c
diff options
context:
space:
mode:
authorJosh Triplett <josh@freedesktop.org>2007-04-28 18:40:28 -0700
committerJunio C Hamano <junkio@cox.net>2007-04-29 02:05:06 -0700
commit28a94f885a735e7474357698ec384de24d526620 (patch)
treeb802381981a49f53dbc332965623b44984b91a76 /ident.c
parent25dc5e2995cc60c59a29b07963f71a1f7608b52f (diff)
downloadgit-28a94f885a735e7474357698ec384de24d526620.tar.gz
Fall back to $EMAIL for missing GIT_AUTHOR_EMAIL and GIT_COMMITTER_EMAIL
Some other programs get the user's email address from $EMAIL, so fall back to that if we don't have a Git-specific email address. Signed-off-by: Josh Triplett <josh@freedesktop.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'ident.c')
-rw-r--r--ident.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ident.c b/ident.c
index 88e7f74e88..69a04b827d 100644
--- a/ident.c
+++ b/ident.c
@@ -196,6 +196,8 @@ const char *fmt_ident(const char *name, const char *email,
if (!name)
name = git_default_name;
if (!email)
+ email = getenv("EMAIL");
+ if (!email)
email = git_default_email;
if (!*name) {