From b9b2ca8ee06c53ee3cfe7d9a9bf47d1d9b62bd4a Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Wed, 14 Oct 2015 21:38:32 +0200 Subject: [PATCH] Make sure we do not show an empty error message if cleanup fails. Signed-off-by: Sven Strickroth --- Languages/Tortoise.pot | 5 +++++ src/Resources/TortoiseProcENG.rc | 2 ++ src/TortoiseProc/Commands/CleanupCommand.cpp | 2 ++ src/TortoiseProc/resource.h | 1 + 4 files changed, 10 insertions(+) diff --git a/Languages/Tortoise.pot b/Languages/Tortoise.pot index e996004555..7358688576 100644 --- a/Languages/Tortoise.pot +++ b/Languages/Tortoise.pot @@ -10692,6 +10692,11 @@ msgstr "" msgid "\"%s\" contains a git submodule. It is likely that this doesn't work any more on the destination after copying.\nDo you want to delete the .git-entry and add all files to the top repository or ignore this possible issue and keep it?" msgstr "" +#. Resource IDs: (IDS_GITEXEERROR_NOMESSAGE) +#, c-format +msgid "\"%s\" exited with an error, however, without generating any output such as an error message." +msgstr "" + #. Resource IDs: (IDS_PROC_REFINVALID) #, c-format msgid "\"%s\" is invalid." diff --git a/src/Resources/TortoiseProcENG.rc b/src/Resources/TortoiseProcENG.rc index b61bc42daa..09155dd189 100644 --- a/src/Resources/TortoiseProcENG.rc +++ b/src/Resources/TortoiseProcENG.rc @@ -3750,6 +3750,8 @@ BEGIN IDS_PROC_GITCONFIG_NOMSYSGIT "Git directory not set (see ""General"" settings page)." IDS_PROC_CLONE_DIR "&Browse..." + IDS_GITEXEERROR_NOMESSAGE + """%s"" exited with an error, however, without generating any output such as an error message." IDS_PROC_CLONE_URLDIREMPTY "URL and directory must not be empty." IDS_PROC_COMMIT_SHOWPATCH "View Patch>>" IDS_PROC_COMMIT_HIDEPATCH "Hide Patch<<" diff --git a/src/TortoiseProc/Commands/CleanupCommand.cpp b/src/TortoiseProc/Commands/CleanupCommand.cpp index de143bbf59..4c3b398d41 100644 --- a/src/TortoiseProc/Commands/CleanupCommand.cpp +++ b/src/TortoiseProc/Commands/CleanupCommand.cpp @@ -124,6 +124,8 @@ static bool GetFilesToCleanUp(CTGitPathList& delList, const CString& baseCmd, CG CString cmdout, cmdouterr; if (pGit->Run(cmd, &cmdout, &cmdouterr, CP_UTF8)) { + if (cmdouterr.IsEmpty()) + cmdouterr.Format(IDS_GITEXEERROR_NOMESSAGE, (LPCTSTR)cmdout); MessageBox(nullptr, cmdouterr, _T("TortoiseGit"), MB_ICONERROR); return false; } diff --git a/src/TortoiseProc/resource.h b/src/TortoiseProc/resource.h index d893c83c0f..8684d77475 100644 --- a/src/TortoiseProc/resource.h +++ b/src/TortoiseProc/resource.h @@ -405,6 +405,7 @@ #define IDC_STATBUTTON 1132 #define IDC_PATCH_TO_CLIPBOARD 1132 #define IDC_LOG 1132 +#define IDS_GITEXEERROR_NOMESSAGE 1132 #define IDC_GRAPHCOMBO 1133 #define IDS_PROC_CLONE_URLDIREMPTY 1133 #define IDC_GRAPHTYPELABEL 1134