Code

ident.c: check explicit identity for name and email separately
[git.git] / ident.c
diff --git a/ident.c b/ident.c
index e6c1798d9814d3a4d9d58a5097523f4b0dd16258..e67c5ad1e8800250f17793bc826d608429d08ae3 100644 (file)
--- a/ident.c
+++ b/ident.c
@@ -249,9 +249,10 @@ const char *git_author_info(int flag)
 
 const char *git_committer_info(int flag)
 {
-       if (getenv("GIT_COMMITTER_NAME") &&
-           getenv("GIT_COMMITTER_EMAIL"))
-               user_ident_explicitly_given = 1;
+       if (getenv("GIT_COMMITTER_NAME"))
+               user_ident_explicitly_given |= IDENT_NAME_GIVEN;
+       if (getenv("GIT_COMMITTER_EMAIL"))
+               user_ident_explicitly_given |= IDENT_MAIL_GIVEN;
        return fmt_ident(getenv("GIT_COMMITTER_NAME"),
                         getenv("GIT_COMMITTER_EMAIL"),
                         getenv("GIT_COMMITTER_DATE"),