OSDN Git Service

Fixed issue #155: Fix SVN Rebase sets upstream as remotes/trunk
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / Commands / RenameCommand.cpp
index 2e6fd36..6bef587 100644 (file)
@@ -52,15 +52,19 @@ bool RenameCommand::Execute()
 \r
        CString cmd;\r
        CString output;\r
-       cmd.Format(_T("git.cmd mv \"%s\" \"%s\""),\r
+       cmd.Format(_T("git.exe mv -- \"%s\" \"%s\""),\r
                                        cmdLinePath.GetGitPathString(),\r
                                        sNewName);\r
                                                                        \r
-       if(g_Git.Run(cmd,&output))\r
+       if(g_Git.Run(cmd,&output,CP_ACP))\r
        {\r
                CMessageBox::Show(hwndExplorer, output, _T("TortoiseGit"), MB_OK);\r
        }\r
 \r
+       CTGitPath newpath;\r
+       newpath.SetFromGit(sNewName);\r
+\r
+       CShellUpdater::Instance().AddPathForUpdate(newpath);\r
 #if 0\r
        TRACE(_T("rename file %s to %s\n"), (LPCTSTR)cmdLinePath.GetWinPathString(), (LPCTSTR)sNewName);\r
        CTSVNPath destinationPath(basePath);\r
@@ -142,7 +146,7 @@ bool RenameCommand::Execute()
                                if (!svn.Move(CTSVNPathList(cmdLinePath), destinationPath, TRUE, sMsg))\r
                                {\r
                                        TRACE(_T("%s\n"), (LPCTSTR)svn.GetLastErrorMessage());\r
-                                       CMessageBox::Show(hwndExplorer, svn.GetLastErrorMessage(), _T("TortoiseSVN"), MB_ICONERROR);\r
+                                       CMessageBox::Show(hwndExplorer, svn.GetLastErrorMessage(), _T("TortoiseGit"), MB_ICONERROR);\r
                                }\r
                                else\r
                                        bRet = true;\r
@@ -166,7 +170,7 @@ bool RenameCommand::Execute()
                                        if (!svn.Move(CTSVNPathList(cmdLinePath), destinationPath, TRUE, sMsg))\r
                                        {\r
                                                TRACE(_T("%s\n"), (LPCTSTR)svn.GetLastErrorMessage());\r
-                                               CMessageBox::Show(hwndExplorer, svn.GetLastErrorMessage(), _T("TortoiseSVN"), MB_ICONERROR);\r
+                                               CMessageBox::Show(hwndExplorer, svn.GetLastErrorMessage(), _T("TortoiseGit"), MB_ICONERROR);\r
                                        }\r
                                        else\r
                                        {\r
@@ -190,7 +194,7 @@ bool RenameCommand::Execute()
                                        }\r
                                        CString sRenameMultipleQuestion;\r
                                        sRenameMultipleQuestion.Format(IDS_PROC_MULTIRENAME, (LPCTSTR)sRenList);\r
-                                       UINT idret = CMessageBox::Show(hwndExplorer, sRenameMultipleQuestion, _T("TortoiseSVN"), MB_ICONQUESTION|MB_YESNOCANCEL);\r
+                                       UINT idret = CMessageBox::Show(hwndExplorer, sRenameMultipleQuestion, _T("TortoiseGit"), MB_ICONQUESTION|MB_YESNOCANCEL);\r
                                        if (idret == IDYES)\r
                                        {\r
                                                CProgressDlg progress;\r
@@ -213,7 +217,7 @@ bool RenameCommand::Execute()
                                                                else\r
                                                                {\r
                                                                        TRACE(_T("%s\n"), (LPCTSTR)svn.GetLastErrorMessage());\r
-                                                                       CMessageBox::Show(hwndExplorer, svn.GetLastErrorMessage(), _T("TortoiseSVN"), MB_ICONERROR);\r
+                                                                       CMessageBox::Show(hwndExplorer, svn.GetLastErrorMessage(), _T("TortoiseGit"), MB_ICONERROR);\r
                                                                        bRet = false;\r
                                                                }\r
                                                        }\r
@@ -231,7 +235,7 @@ bool RenameCommand::Execute()
                                                if (!svn.Move(CTSVNPathList(cmdLinePath), destinationPath, TRUE, sMsg))\r
                                                {\r
                                                        TRACE(_T("%s\n"), (LPCTSTR)svn.GetLastErrorMessage());\r
-                                                       CMessageBox::Show(hwndExplorer, svn.GetLastErrorMessage(), _T("TortoiseSVN"), MB_ICONERROR);\r
+                                                       CMessageBox::Show(hwndExplorer, svn.GetLastErrorMessage(), _T("TortoiseGit"), MB_ICONERROR);\r
                                                }\r
                                                else\r
                                                {\r
@@ -248,5 +252,6 @@ bool RenameCommand::Execute()
                }\r
        }\r
 #endif\r
+       CShellUpdater::Instance().Flush();\r
        return bRet;\r
 }\r