Commit b9b2ca8e authored by Sven Strickroth's avatar Sven Strickroth

Make sure we do not show an empty error message if cleanup fails.

Signed-off-by: Sven Strickroth's avatarSven Strickroth <email@cs-ware.de>
parent 7491750a
......@@ -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."
......
......@@ -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<<"
......
......@@ -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);
    1. cmdout?
    • cmdout will be lots of "Would remove..." strings.
    • should be cmd here?
    1. Only for this Run case?
    • How about add some code here
    	if (outputErr)
    	{
    		vectorErr.push_back(0);
    		StringAppend(outputErr, &(vectorErr[0]), code);
    		if (ret && outputErr->IsEmpty())
    			outputErr->Format(L"\"%s\" exited with an error(%d), however, without generating any output such as an error message.", (LPCTSTR)cmd, ret);
    	}
    
  • cmdout does not contain error messages.

    I also thought about adding the code you posted, however, I'm unsure whether it will break other things.

    Edited by Sven Strickroth
Please register or sign in to reply
MessageBox(nullptr, cmdouterr, _T("TortoiseGit"), MB_ICONERROR);
return false;
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment