From 00195e070857398cc8900bbe6e92a8616662a4a1 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sun, 13 Jan 2013 13:05:51 +0100 Subject: [PATCH] Reset last error messages after displaying Signed-off-by: Sven Strickroth --- src/Git/Git.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Git/Git.cpp b/src/Git/Git.cpp index 50bc57241..eeb7f665d 100644 --- a/src/Git/Git.cpp +++ b/src/Git/Git.cpp @@ -1204,7 +1204,9 @@ CString CGit::GetGitLastErr(CString msg) const git_error *libgit2err = giterr_last(); if (libgit2err) { - return msg + _T("\nlibgit2 returned: ") + CUnicodeUtils::GetUnicode(CStringA(libgit2err->message)); + CString lastError = CUnicodeUtils::GetUnicode(CStringA(libgit2err->message)); + giterr_clear(); + return msg + _T("\nlibgit2 returned: ") + lastError; } else { @@ -1214,7 +1216,11 @@ CString CGit::GetGitLastErr(CString msg) else if (gitLastErr.IsEmpty()) return msg + _T("\nUnknown git.exe error."); else - return msg + _T("\n") + gitLastErr; + { + CString lastError = gitLastErr; + gitLastErr.Empty(); + return msg + _T("\n") + lastError; + } } CString CGit::FixBranchName_Mod(CString& branchName) -- 2.11.4.GIT