Fixed issue #1642: Incorrect behavior if repo is located on root of drive
authorSup Yut Sum <ch3cooli@gmail.com>
Mon, 11 Feb 2013 02:35:48 +0000 (11 10:35 +0800)
committerSup Yut Sum <ch3cooli@gmail.com>
Mon, 11 Feb 2013 02:35:48 +0000 (11 10:35 +0800)
Signed-off-by: Sup Yut Sum <ch3cooli@gmail.com>
src/Changelog.txt
src/Git/GitAdminDir.cpp

index 292a01a..af7c45e 100644 (file)
@@ -10,6 +10,9 @@ Released: unreleased
  * Fixed issue #1597: Reduce chance of committing old submodule revision on cherry-pick / rebase conflicts\r
  * Can specify specific paths of submodules to update\r
 \r
+== Bug Fixes ==\r
+ * Fixed issue #1642: Incorrect behavior if repo is located on root of drive\r
+\r
 = Release 1.8.1.0 =\r
 Released: 2013-02-07\r
 \r
index 6f27402..8bd780b 100644 (file)
@@ -77,6 +77,9 @@ bool GitAdminDir::HasAdminDir(const CString& path, bool bDir,CString *ProjectTop
        CString sDirName = path;\r
        if (!bDir)\r
        {\r
+               // e.g "C:\"\r
+               if (path.GetLength() <= 3)\r
+                       return false;\r
                sDirName = path.Left(path.ReverseFind(_T('\\')));\r
        }\r
 \r