From ec563e8153cba89728a271a26c8a94e7a42d8152 Mon Sep 17 00:00:00 2001
From: Pierre Habouzit <madcoder@debian.org>
Date: Tue, 5 Jun 2007 18:40:41 +0200
Subject: [PATCH] $EMAIL is a last resort fallback, as it's system-wide.

$EMAIL is a system-wide setup that is used for many many many
applications. If the git user chose a specific user.email setup,
then _this_ should be honoured rather than $EMAIL.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 ident.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ident.c b/ident.c
index 69a04b827d..3d49608e6f 100644
--- a/ident.c
+++ b/ident.c
@@ -195,10 +195,10 @@ const char *fmt_ident(const char *name, const char *email,
 	setup_ident();
 	if (!name)
 		name = git_default_name;
-	if (!email)
-		email = getenv("EMAIL");
 	if (!email)
 		email = git_default_email;
+	if (!email)
+		email = getenv("EMAIL");
 
 	if (!*name) {
 		struct passwd *pw;
-- 
2.49.0