aboutsummaryrefslogtreecommitdiff
path: root/Git/Construct.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-02-08 15:31:03 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-02-08 15:39:04 -0400
commitb1915b9054ffa57e84c1300ac0d0d9bc1c7af20d (patch)
treec4b7771e493a5c8997e04dcf93868e6d5b94fe89 /Git/Construct.hs
parent97f152eff1d9b1c7543844dacda8c264aadede9f (diff)
Windows: Fix handling of absolute unix-style git repository paths.
Note that on Windows a remote with a path like /home/foo/bar is interpreted by git as being some screwy relative path (relative to what exactly seems ill-defined -- it seemed relative to C:\Program Files\Git\ in my tests!) So no attempt has been made to handle such a path sanely, just not to crash when encountering it. Note that "C:\\foo" </> "/home/foo/bar" yields /home/foo/bar even though that is not absolute! I don't know what to make of all this, except that I will be very happy when this crock of **** vanishes from the face of the earth.
Diffstat (limited to 'Git/Construct.hs')
-rw-r--r--Git/Construct.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Git/Construct.hs b/Git/Construct.hs
index 71a13f49f..eed2b9930 100644
--- a/Git/Construct.hs
+++ b/Git/Construct.hs
@@ -33,6 +33,7 @@ import Common
import Git.Types
import Git
import Git.Remote
+import Git.FilePath
import qualified Git.Url as Url
import Utility.UserInfo
@@ -57,7 +58,7 @@ fromPath dir = fromAbsPath =<< absPath dir
- specified. -}
fromAbsPath :: FilePath -> IO Repo
fromAbsPath dir
- | isAbsolute dir = ifM (doesDirectoryExist dir') ( ret dir' , hunt )
+ | absoluteGitPath dir = ifM (doesDirectoryExist dir') ( ret dir' , hunt )
| otherwise =
error $ "internal error, " ++ dir ++ " is not absolute"
where