OSDN Git Service

Fixed issue #133: Command fails on folder with leading dash
authorFrank Li <lznuaa@gmail.com>
Tue, 11 Aug 2009 15:24:02 +0000 (23:24 +0800)
committerFrank Li <lznuaa@gmail.com>
Tue, 11 Aug 2009 15:24:02 +0000 (23:24 +0800)
And -- to separate file and git options

Signed-off-by: Frank Li <lznuaa@gmail.com>
src/Git/Git.cpp
src/Git/GitStatusListCtrl.cpp
src/TortoiseGit.sln
src/TortoiseProc/AppUtils.cpp
src/TortoiseProc/Commands/AddCommand.cpp
src/TortoiseProc/Commands/RemoveCommand.cpp
src/TortoiseProc/SVNProgressDlg.cpp

index f17e638..ae4c4ef 100644 (file)
@@ -1158,7 +1158,7 @@ int CGit::Revert(CTGitPath &path,bool keep)
        CString cmd, out;\r
        if(path.m_Action & CTGitPath::LOGACTIONS_ADDED)\r
        {       //To init git repository, there are not HEAD, so we can use git reset command\r
-               cmd.Format(_T("git.exe rm --cached \"%s\""),path.GetGitPathString());\r
+               cmd.Format(_T("git.exe rm --cached -- \"%s\""),path.GetGitPathString());\r
 \r
                if(g_Git.Run(cmd,&out,CP_ACP))\r
                        return -1;\r
index b28692c..40a702f 100644 (file)
@@ -2749,7 +2749,7 @@ void CGitStatusListCtrl::OnContextMenuList(CWnd * pWnd, CPoint point)
                                                if(path == NULL)\r
                                                        continue;\r
                                                CString cmd;\r
-                                               cmd.Format(_T("git.exe add \"%s\""),path->GetGitPathString());\r
+                                               cmd.Format(_T("git.exe add -- \"%s\""),path->GetGitPathString());\r
                                                CString output;\r
                                                if(!g_Git.Run(cmd,&output,CP_ACP))\r
                                                {\r
@@ -2891,7 +2891,7 @@ void CGitStatusListCtrl::OnContextMenuList(CWnd * pWnd, CPoint point)
                                                output.Empty();\r
                                                if ( fentry->m_Action & CTGitPath::LOGACTIONS_UNMERGED)\r
                                                {\r
-                                                       gitcmd.Format(_T("git.exe add \"%s\""),fentry->GetGitPathString());\r
+                                                       gitcmd.Format(_T("git.exe add -- \"%s\""),fentry->GetGitPathString());\r
                                                        if(g_Git.Run(gitcmd,&output,CP_ACP))\r
                                                        {\r
                                                                CMessageBox::Show(m_hWnd, output, _T("TortoiseGit"), MB_ICONERROR);\r
@@ -3317,6 +3317,7 @@ void CGitStatusListCtrl::OnContextMenuList(CWnd * pWnd, CPoint point)
                                                                                {\r
                                                                                        path->m_Action = CTGitPath::LOGACTIONS_UNVER;\r
                                                                                        SetEntryCheck(path,nItem,false);\r
+                                                                                       PrepareGroups(true);\r
                                                                                        SetItemGroup(nItem,1);\r
                                                                                        this->m_StatusFileList.RemoveItem(*path);\r
                                                                                        this->m_UnRevFileList.AddPath(*path);\r
index 097b53e..92ff73e 100644 (file)
@@ -105,6 +105,15 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libaprutil", "..\ext\build\
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TortoiseIDiff", "TortoiseIDiff\TortoiseIDiff.vcproj", "{6D95829D-AE04-47A7-B66B-DC2F581DDF01}"\r
 EndProject\r
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TGit", "TGit", "{2CB340C3-B2ED-46F4-981E-847747E0A3BF}"\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libgit", "..\ext\tgit\contrib\vcbuild\libgit\libgit.vcproj", "{F6DEC8C3-B803-4A86-8848-430F08B499E3}"\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "git", "..\ext\tgit\contrib\vcbuild\git\git.vcproj", "{E3E30E51-C5AD-407B-AB43-985E4111474A}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {F6DEC8C3-B803-4A86-8848-430F08B499E3} = {F6DEC8C3-B803-4A86-8848-430F08B499E3}\r
+       EndProjectSection\r
+EndProject\r
 Global\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
                debug_static|Win32 = debug_static|Win32\r
@@ -450,8 +459,36 @@ Global
                {6D95829D-AE04-47A7-B66B-DC2F581DDF01}.Release|Win32.Build.0 = Release|Win32\r
                {6D95829D-AE04-47A7-B66B-DC2F581DDF01}.Release|x64.ActiveCfg = Release|x64\r
                {6D95829D-AE04-47A7-B66B-DC2F581DDF01}.Release|x64.Build.0 = Release|x64\r
+               {F6DEC8C3-B803-4A86-8848-430F08B499E3}.debug_static|Win32.ActiveCfg = Debug|Win32\r
+               {F6DEC8C3-B803-4A86-8848-430F08B499E3}.debug_static|Win32.Build.0 = Debug|Win32\r
+               {F6DEC8C3-B803-4A86-8848-430F08B499E3}.debug_static|x64.ActiveCfg = Debug|Win32\r
+               {F6DEC8C3-B803-4A86-8848-430F08B499E3}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {F6DEC8C3-B803-4A86-8848-430F08B499E3}.Debug|Win32.Build.0 = Debug|Win32\r
+               {F6DEC8C3-B803-4A86-8848-430F08B499E3}.Debug|x64.ActiveCfg = Debug|Win32\r
+               {F6DEC8C3-B803-4A86-8848-430F08B499E3}.release_static|Win32.ActiveCfg = Release|Win32\r
+               {F6DEC8C3-B803-4A86-8848-430F08B499E3}.release_static|Win32.Build.0 = Release|Win32\r
+               {F6DEC8C3-B803-4A86-8848-430F08B499E3}.release_static|x64.ActiveCfg = Release|Win32\r
+               {F6DEC8C3-B803-4A86-8848-430F08B499E3}.Release|Win32.ActiveCfg = Release|Win32\r
+               {F6DEC8C3-B803-4A86-8848-430F08B499E3}.Release|Win32.Build.0 = Release|Win32\r
+               {F6DEC8C3-B803-4A86-8848-430F08B499E3}.Release|x64.ActiveCfg = Release|Win32\r
+               {E3E30E51-C5AD-407B-AB43-985E4111474A}.debug_static|Win32.ActiveCfg = Debug|Win32\r
+               {E3E30E51-C5AD-407B-AB43-985E4111474A}.debug_static|Win32.Build.0 = Debug|Win32\r
+               {E3E30E51-C5AD-407B-AB43-985E4111474A}.debug_static|x64.ActiveCfg = Debug|Win32\r
+               {E3E30E51-C5AD-407B-AB43-985E4111474A}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {E3E30E51-C5AD-407B-AB43-985E4111474A}.Debug|Win32.Build.0 = Debug|Win32\r
+               {E3E30E51-C5AD-407B-AB43-985E4111474A}.Debug|x64.ActiveCfg = Debug|Win32\r
+               {E3E30E51-C5AD-407B-AB43-985E4111474A}.release_static|Win32.ActiveCfg = Release|Win32\r
+               {E3E30E51-C5AD-407B-AB43-985E4111474A}.release_static|Win32.Build.0 = Release|Win32\r
+               {E3E30E51-C5AD-407B-AB43-985E4111474A}.release_static|x64.ActiveCfg = Release|Win32\r
+               {E3E30E51-C5AD-407B-AB43-985E4111474A}.Release|Win32.ActiveCfg = Release|Win32\r
+               {E3E30E51-C5AD-407B-AB43-985E4111474A}.Release|Win32.Build.0 = Release|Win32\r
+               {E3E30E51-C5AD-407B-AB43-985E4111474A}.Release|x64.ActiveCfg = Release|Win32\r
        EndGlobalSection\r
        GlobalSection(SolutionProperties) = preSolution\r
                HideSolutionNode = FALSE\r
        EndGlobalSection\r
+       GlobalSection(NestedProjects) = preSolution\r
+               {F6DEC8C3-B803-4A86-8848-430F08B499E3} = {2CB340C3-B2ED-46F4-981E-847747E0A3BF}\r
+               {E3E30E51-C5AD-407B-AB43-985E4111474A} = {2CB340C3-B2ED-46F4-981E-847747E0A3BF}\r
+       EndGlobalSection\r
 EndGlobal\r
index 303f989..1061693 100644 (file)
@@ -1449,9 +1449,9 @@ bool CAppUtils::ConflictEdit(CTGitPath &path,bool bAlternativeTool)
                        CString cmd,out;\r
                        if(dlg.m_bIsDelete)\r
                        {\r
-                               cmd.Format(_T("git.exe rm \"%s\""),merge.GetGitPathString());\r
+                               cmd.Format(_T("git.exe rm -- \"%s\""),merge.GetGitPathString());\r
                        }else\r
-                               cmd.Format(_T("git.exe add \"%s\""),merge.GetGitPathString());\r
+                               cmd.Format(_T("git.exe add -- \"%s\""),merge.GetGitPathString());\r
 \r
                        if(g_Git.Run(cmd,&out,CP_ACP))\r
                        {\r
index bce2411..f20f85a 100644 (file)
@@ -60,7 +60,7 @@ bool AddCommand::Execute()
                                int success=0;\r
                                for(int i=0;i<dlg.m_pathList.GetCount();i++)\r
                                {\r
-                                       cmd.Format(_T("git.exe add \"%s\""),dlg.m_pathList[i].GetGitPathString());\r
+                                       cmd.Format(_T("git.exe add -- \"%s\""),dlg.m_pathList[i].GetGitPathString());\r
                                        if(g_Git.Run(cmd,&out,CP_ACP))\r
                                        {\r
                                                CMessageBox::Show(NULL,out,_T("TortoiseGit"),MB_OK|MB_ICONERROR);\r
index fd61d80..6a9698a 100644 (file)
@@ -130,7 +130,7 @@ bool RemoveCommand::Execute()
                format= _T("git.exe update-index --force-remove -- \"%s\"");\r
        }else\r
        {\r
-               format=_T("git.exe rm -r -f \"%s\"");\r
+               format=_T("git.exe rm -r -f -- \"%s\"");\r
        }\r
 \r
        CString output;\r
index fb5eef1..d57a24e 100644 (file)
@@ -1816,7 +1816,7 @@ bool CGitProgressDlg::CmdAdd(CString& sWindowTitle, bool& localoperation)
        for(int i=0;i<m_targetPathList.GetCount();i++)\r
        {\r
                CString cmd,out;\r
-               cmd.Format(_T("git.exe add -f \"%s\""),m_targetPathList[i].GetGitPathString());\r
+               cmd.Format(_T("git.exe add -f -- \"%s\""),m_targetPathList[i].GetGitPathString());\r
                if(g_Git.Run(cmd,&out,CP_ACP))\r
                {\r
                        CMessageBox::Show(NULL,out,_T("TortoiseGit"),MB_OK|MB_ICONERROR);\r
@@ -2367,7 +2367,7 @@ bool CGitProgressDlg::CmdResolve(CString& sWindowTitle, bool& localoperation)
        for(int i=0;i<m_targetPathList.GetCount();i++)\r
        {\r
                CString cmd,out,tempmergefile;\r
-               cmd.Format(_T("git.exe add -f \"%s\""),m_targetPathList[i].GetGitPathString());\r
+               cmd.Format(_T("git.exe add -f -- \"%s\""),m_targetPathList[i].GetGitPathString());\r
                if(g_Git.Run(cmd,&out,CP_ACP))\r
                {\r
                        CMessageBox::Show(NULL,out,_T("TortoiseGit"),MB_OK|MB_ICONERROR);\r