diff options
author | Joey Hess <joey@kitenet.net> | 2013-05-14 15:37:24 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-05-14 15:37:24 -0400 |
commit | ea7f916c04e0b1ee022b3e4987be749db28fa2fa (patch) | |
tree | 0698a987c4b475fdccfe48bb2a8f1abebf55b844 /Git/Construct.hs | |
parent | c2f6f82a146339bb4b94acff1aae4f12ad023a08 (diff) | |
parent | 724d5185d48aee309af1a6d13927c4f7108610fd (diff) |
Merge branch 'master' into windows
Conflicts:
Annex/Environment.hs
Build/Configure.hs
Git/Construct.hs
Utility/FileMode.hs
Diffstat (limited to 'Git/Construct.hs')
-rw-r--r-- | Git/Construct.hs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Git/Construct.hs b/Git/Construct.hs index 1ed91a017..a30071585 100644 --- a/Git/Construct.hs +++ b/Git/Construct.hs @@ -23,6 +23,8 @@ module Git.Construct ( checkForRepo, ) where +{-# LANGUAGE CPP #-} + #ifndef __WINDOWS__ import System.Posix.User #endif @@ -143,6 +145,9 @@ fromRemoteLocation :: String -> Repo -> IO Repo fromRemoteLocation s repo = gen $ calcloc s where gen v +#ifdef __WINDOWS__ + | dosstyle v = fromRemotePath v repo +#endif | scpstyle v = fromUrl $ scptourl v | urlstyle v = fromUrl v | otherwise = fromRemotePath v repo @@ -176,6 +181,11 @@ fromRemoteLocation s repo = gen $ calcloc s | "/" `isPrefixOf` d = d | "~" `isPrefixOf` d = '/':d | otherwise = "/~/" ++ d +#ifdef __WINDOWS__ + -- git on Windows will write a path to .git/config with "drive:", + -- which is not to be confused with a "host:" + dosstyle = hasDrive +#endif {- Constructs a Repo from the path specified in the git remotes of - another Repo. -} |