From 379fe92733f41f0578350f623b7eddffec8a6425 Mon Sep 17 00:00:00 2001 From: Frank Li Date: Thu, 13 Aug 2009 15:42:11 +0800 Subject: [PATCH] Fixed issue #133: (mv\rename problem) Command fails on folder with leading dash And -- to separate file and git options Signed-off-by: Frank Li --- src/Git/Git.cpp | 2 +- src/TortoiseProc/Commands/DropMoveCommand.cpp | 2 +- src/TortoiseProc/Commands/RenameCommand.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Git/Git.cpp b/src/Git/Git.cpp index ae4c4ef80..0d00b9ae9 100644 --- a/src/Git/Git.cpp +++ b/src/Git/Git.cpp @@ -1165,7 +1165,7 @@ int CGit::Revert(CTGitPath &path,bool keep) } else if(path.m_Action & CTGitPath::LOGACTIONS_REPLACED ) { - cmd.Format(_T("git.exe mv \"%s\" \"%s\""),path.GetGitPathString(),path.GetGitOldPathString()); + cmd.Format(_T("git.exe mv -- \"%s\" \"%s\""),path.GetGitPathString(),path.GetGitOldPathString()); if(g_Git.Run(cmd,&out,CP_ACP)) return -1; diff --git a/src/TortoiseProc/Commands/DropMoveCommand.cpp b/src/TortoiseProc/Commands/DropMoveCommand.cpp index 61adaf934..977b60d9a 100644 --- a/src/TortoiseProc/Commands/DropMoveCommand.cpp +++ b/src/TortoiseProc/Commands/DropMoveCommand.cpp @@ -92,7 +92,7 @@ bool DropMoveCommand::Execute() } CString cmd,out; - cmd.Format(_T("git.exe mv \"%s\" \"%s\""),pathList[nPath].GetGitPathString(),destPath.GetGitPathString()); + cmd.Format(_T("git.exe mv -- \"%s\" \"%s\""),pathList[nPath].GetGitPathString(),destPath.GetGitPathString()); if(g_Git.Run(cmd,&out,CP_ACP)) { if (CMessageBox::Show(hwndExplorer, out, _T("TortoiseGit"), MB_YESNO)==IDYES) diff --git a/src/TortoiseProc/Commands/RenameCommand.cpp b/src/TortoiseProc/Commands/RenameCommand.cpp index e39479d7f..7554b367f 100644 --- a/src/TortoiseProc/Commands/RenameCommand.cpp +++ b/src/TortoiseProc/Commands/RenameCommand.cpp @@ -52,7 +52,7 @@ bool RenameCommand::Execute() CString cmd; CString output; - cmd.Format(_T("git.exe mv \"%s\" \"%s\""), + cmd.Format(_T("git.exe mv -- \"%s\" \"%s\""), cmdLinePath.GetGitPathString(), sNewName); -- 2.11.4.GIT