summaryrefslogtreecommitdiff
path: root/Git
diff options
context:
space:
mode:
Diffstat (limited to 'Git')
-rwxr-xr-x[-rw-r--r--]Git/Config.hs0
-rwxr-xr-xGit/Construct.hs6
-rwxr-xr-xGit/CurrentRepo.hs8
3 files changed, 12 insertions, 2 deletions
diff --git a/Git/Config.hs b/Git/Config.hs
index adc75a208..adc75a208 100644..100755
--- a/Git/Config.hs
+++ b/Git/Config.hs
diff --git a/Git/Construct.hs b/Git/Construct.hs
index f7aca6130..1ed91a017 100755
--- a/Git/Construct.hs
+++ b/Git/Construct.hs
@@ -23,7 +23,7 @@ module Git.Construct (
checkForRepo,
) where
-#ifndef mingw32_HOST_OS
+#ifndef __WINDOWS__
import System.Posix.User
#endif
import qualified Data.Map as M hiding (map, split)
@@ -196,6 +196,9 @@ repoAbsPath d = do
return $ h </> d'
expandTilde :: FilePath -> IO FilePath
+#ifdef __WINDOWS__
+expandTilde = return
+#else
expandTilde = expandt True
where
expandt _ [] = return ""
@@ -216,6 +219,7 @@ expandTilde = expandt True
findname n (c:cs)
| c == '/' = (n, cs)
| otherwise = findname (n++[c]) cs
+#endif
{- Checks if a git repository exists in a directory. Does not find
- git repositories in parent directories. -}
diff --git a/Git/CurrentRepo.hs b/Git/CurrentRepo.hs
index b2c15c23f..4b8c1fca8 100755
--- a/Git/CurrentRepo.hs
+++ b/Git/CurrentRepo.hs
@@ -9,7 +9,7 @@
module Git.CurrentRepo where
-#ifndef mingw32_HOST_OS
+#ifndef __WINDOWS__
import System.Posix.Directory (changeWorkingDirectory)
import System.Posix.Env (getEnv, unsetEnv)
#endif
@@ -39,18 +39,24 @@ get = do
case wt of
Nothing -> return r
Just d -> do
+#ifndef __WINDOWS__
cwd <- getCurrentDirectory
unless (d `dirContains` cwd) $
changeWorkingDirectory d
+#endif
return $ addworktree wt r
where
pathenv s = do
+#ifndef __WINDOWS__
v <- getEnv s
case v of
Just d -> do
unsetEnv s
Just <$> absPath d
Nothing -> return Nothing
+#else
+ return Nothing
+#endif
configure Nothing (Just r) = Git.Config.read r
configure (Just d) _ = do