From 2d5557ed128994189a2a76f6ce1d3652b66c10a2 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sun, 15 Apr 2012 01:56:49 +0200 Subject: [PATCH] Fixed issue #1061: Environment variables ignored: GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL Signed-off-by: Sven Strickroth --- src/Changelog.txt | 1 + src/Git/Git.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/Changelog.txt b/src/Changelog.txt index f28a2cfca..06e88fd86 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -1,6 +1,7 @@ = Release 1.7.9.0 = == Bug Fix == * Fixed issue #1123: Apply patch serial does not correctly add patches to list if >3 patches are selected + * Fixed issue #1061: Enviroment variables ignored: GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL = Release 1.7.8.0 = == Features== diff --git a/src/Git/Git.cpp b/src/Git/Git.cpp index c7754e66e..7b3a355b6 100644 --- a/src/Git/Git.cpp +++ b/src/Git/Git.cpp @@ -440,10 +440,21 @@ int CGit::Run(CString cmd, CString* output, CString* outputErr, int code) CString CGit::GetUserName(void) { + CEnvironment env; + env.CopyProcessEnvironment(); + CString envname = env.GetEnv(_T("GIT_AUTHOR_NAME")); + if (!envname.IsEmpty()) + return envname; return GetConfigValue(L"user.name", this->GetGitEncode(L"i18n.commitencoding")); } CString CGit::GetUserEmail(void) { + CEnvironment env; + env.CopyProcessEnvironment(); + CString envmail = env.GetEnv(_T("GIT_AUTHOR_EMAIL")); + if (!envmail.IsEmpty()) + return envmail; + return GetConfigValue(L"user.email"); } -- 2.11.4.GIT