OSDN Git Service

Fixed issue #71: (TortoiseProc problem)Icon Overlays don't work in root of drive
authorFrank Li <lznuaa@gmail.com>
Sat, 18 Jul 2009 06:11:15 +0000 (14:11 +0800)
committerFrank Li <lznuaa@gmail.com>
Sat, 18 Jul 2009 06:11:15 +0000 (14:11 +0800)
When m_CurrentDir =C:\, not C:,  pathlist calulate wrong.

src/Git/Git.h
src/TortoiseProc/Commands/Command.h
src/TortoiseShell/resourceshell.rc

index 90fc1c6..2cc24fd 100644 (file)
@@ -57,7 +57,12 @@ public:
 \r
        bool SetCurrentDir(CString path)\r
        {\r
-               return m_GitDir.HasAdminDir(path,&m_CurrentDir);\r
+               bool b = m_GitDir.HasAdminDir(path,&m_CurrentDir);\r
+               if(m_CurrentDir.GetLength() == 2 && m_CurrentDir[1] == _T(':')) //C: D:\r
+               {\r
+                       m_CurrentDir+=_T('\\');\r
+               }\r
+               return b;\r
        }\r
        CString m_CurrentDir;\r
 \r
index 34fb9a7..f0e2f42 100644 (file)
@@ -42,8 +42,15 @@ public:
                                                                orgCmdLinePath = path;\r
                                                                CString WinPath=path.GetWinPath();\r
                                                                if(WinPath.Left(g_Git.m_CurrentDir.GetLength())==g_Git.m_CurrentDir)\r
-                                                                       cmdLinePath.SetFromWin( WinPath.Right(WinPath.GetLength()-g_Git.m_CurrentDir.GetLength()-1));\r
-                                                               \r
+                                                               {\r
+                                                                       if(g_Git.m_CurrentDir[g_Git.m_CurrentDir.GetLength()-1] == _T('\\'))\r
+                                                                       {\r
+                                                                               cmdLinePath.SetFromWin( WinPath.Right(WinPath.GetLength()-g_Git.m_CurrentDir.GetLength()));\r
+                                                                       }else\r
+                                                                       {\r
+                                                                               cmdLinePath.SetFromWin( WinPath.Right(WinPath.GetLength()-g_Git.m_CurrentDir.GetLength()-1));\r
+                                                                       }\r
+                                                               }\r
                                                                orgPathList = plist; \r
                                                                for(int i=0;i<plist.GetCount();i++)\r
                                                                {\r
@@ -51,7 +58,13 @@ public:
                                                                        CTGitPath p;\r
                                                                        if(WinPath.Left(g_Git.m_CurrentDir.GetLength())==g_Git.m_CurrentDir)\r
                                                                        {\r
-                                                                               p.SetFromWin( WinPath.Right(WinPath.GetLength()-g_Git.m_CurrentDir.GetLength()-1));\r
+                                                                               if(g_Git.m_CurrentDir[g_Git.m_CurrentDir.GetLength()-1] == _T('\\'))\r
+                                                                               {\r
+                                                                                       p.SetFromWin( WinPath.Right(WinPath.GetLength()-g_Git.m_CurrentDir.GetLength()));\r
+                                                                               }else\r
+                                                                               {\r
+                                                                                       p.SetFromWin( WinPath.Right(WinPath.GetLength()-g_Git.m_CurrentDir.GetLength()-1));\r
+                                                                               }\r
                                                                        }else\r
                                                                                p=plist[i];\r
                                                                        pathList.AddPath(p);\r
index 0f9d01c..00a0ed8 100644 (file)
@@ -217,7 +217,7 @@ END
 \r
 STRINGTABLE \r
 BEGIN\r
-    IDS_MENUSWITCH          "S&witch..."\r
+    IDS_MENUSWITCH          "S&witch/Checkout..."\r
     IDS_MENUMERGE           "&Merge..."\r
     IDS_MENUBRANCH          "Create Branch..."\r
     IDS_MENUIMPORT          "&Import..."\r
@@ -232,7 +232,7 @@ BEGIN
     IDS_MENUDESCREVERT      "Reverts all changes you made since the last update"\r
     IDS_MENUDESCCLEANUP     "Cleanup interrupted operations, locked files, ..."\r
     IDS_MENUDESCRESOLVE     "Resolves conflicted files"\r
-    IDS_MENUDESCSWITCH      "Switch working copy to another branch / tag"\r
+    IDS_MENUDESCSWITCH      "Switch/Checkout working copy to another branch / tag"\r
 END\r
 \r
 STRINGTABLE \r