OSDN Git Service

Issue 30: Clone does not support UNC path to repository
authorColin Law <colin@clanlaw.org.uk>
Thu, 5 Feb 2009 14:47:53 +0000 (14:47 +0000)
committerFrank Li <lznuaa@gmail.com>
Thu, 5 Feb 2009 15:08:35 +0000 (23:08 +0800)
This is a bit of a hack and only fixes it for the repository, not the destination.
There are probably many other places where a UNC path will not work and this is
expected to be fixed in new version of msysgit.
It is worth doing this here however as the most likely place for a user to require a UNC path is when cloning.

src/TortoiseProc/Commands/CloneCommand.cpp

index 67b74db..eb3cb0c 100644 (file)
@@ -35,6 +35,13 @@ bool CloneCommand::Execute()
        {\r
                CString dir=dlg.m_Directory;\r
                CString url=dlg.m_URL;\r
+               // is this a windows format UNC path, ie starts with \\ \r
+               if (url.Find(_T("\\\\")) == 0)\r
+               {\r
+                       // yes, change all \ to /\r
+                       // this should not be necessary but msysgit does not support the use \ here yet\r
+                       url.Replace( _T('\\'), _T('/'));\r
+               }\r
                CString cmd;\r
                cmd.Format(_T("git.exe clone \"%s\" \"%s\""),\r
                                                url,\r