OSDN Git Service

Fixed issue #133: (mv\rename problem) Command fails on folder with leading dash
authorFrank Li <lznuaa@gmail.com>
Thu, 13 Aug 2009 07:42:11 +0000 (15:42 +0800)
committerFrank Li <lznuaa@gmail.com>
Thu, 13 Aug 2009 07:42:11 +0000 (15:42 +0800)
And -- to separate file and git options

Signed-off-by: Frank Li <lznuaa@gmail.com>
src/Git/Git.cpp
src/TortoiseProc/Commands/DropMoveCommand.cpp
src/TortoiseProc/Commands/RenameCommand.cpp

index ae4c4ef..0d00b9a 100644 (file)
@@ -1165,7 +1165,7 @@ int CGit::Revert(CTGitPath &path,bool keep)
        }\r
        else if(path.m_Action & CTGitPath::LOGACTIONS_REPLACED )\r
        {\r
-               cmd.Format(_T("git.exe mv \"%s\" \"%s\""),path.GetGitPathString(),path.GetGitOldPathString());\r
+               cmd.Format(_T("git.exe mv -- \"%s\" \"%s\""),path.GetGitPathString(),path.GetGitOldPathString());\r
                if(g_Git.Run(cmd,&out,CP_ACP))\r
                        return -1;\r
                \r
index 61adaf9..977b60d 100644 (file)
@@ -92,7 +92,7 @@ bool DropMoveCommand::Execute()
                } \r
                CString cmd,out;\r
                \r
-               cmd.Format(_T("git.exe mv \"%s\" \"%s\""),pathList[nPath].GetGitPathString(),destPath.GetGitPathString());\r
+               cmd.Format(_T("git.exe mv -- \"%s\" \"%s\""),pathList[nPath].GetGitPathString(),destPath.GetGitPathString());\r
                if(g_Git.Run(cmd,&out,CP_ACP))\r
                {\r
                        if (CMessageBox::Show(hwndExplorer, out, _T("TortoiseGit"), MB_YESNO)==IDYES)\r
index e39479d..7554b36 100644 (file)
@@ -52,7 +52,7 @@ bool RenameCommand::Execute()
 \r
        CString cmd;\r
        CString output;\r
-       cmd.Format(_T("git.exe mv \"%s\" \"%s\""),\r
+       cmd.Format(_T("git.exe mv -- \"%s\" \"%s\""),\r
                                        cmdLinePath.GetGitPathString(),\r
                                        sNewName);\r
                                                                        \r