From 019f1c88f28547ca1bd01dc50380cc1445ea3073 Mon Sep 17 00:00:00 2001 From: Sup Yut Sum Date: Fri, 6 Jun 2014 20:57:41 +0800 Subject: [PATCH] git diff --no-index exit code 1 means there are differences, not an error Signed-off-by: Sup Yut Sum --- src/TortoiseMerge/AppUtils.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/TortoiseMerge/AppUtils.cpp b/src/TortoiseMerge/AppUtils.cpp index b4a996b80..9507df21f 100644 --- a/src/TortoiseMerge/AppUtils.cpp +++ b/src/TortoiseMerge/AppUtils.cpp @@ -89,7 +89,8 @@ bool CAppUtils::CreateUnifiedDiff(const CString& orig, const CString& modified, CString cmd, err; cmd.Format(_T("git.exe diff --no-index -- \"%s\" \"%s\""),orig, modified); - if(g_Git.RunLogFile(cmd, output, &err) && bShowError) + int result = g_Git.RunLogFile(cmd, output, &err); + if (result != 0 && result != 1 && bShowError) { MessageBox(NULL, _T("Failed to create patch.\n") + err, _T("TortoiseGit"), MB_OK | MB_ICONERROR); return false; -- 2.11.4.GIT