aboutsummaryrefslogtreecommitdiff
path: root/Git/CurrentRepo.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <id@joeyh.name>2013-05-11 15:03:00 -0500
committerGravatar Joey Hess <id@joeyh.name>2013-05-11 15:03:00 -0500
commitd0fa82fb721cdc85438287e29a94cb796b7bc464 (patch)
tree26a2486b8e715b5937ce41679eafd42c02f2310a /Git/CurrentRepo.hs
parent679eaf6077375c5d59501d12c79e0891cbdd904f (diff)
git-annex now builds on Windows (doesn't work)
Diffstat (limited to 'Git/CurrentRepo.hs')
-rwxr-xr-xGit/CurrentRepo.hs8
1 files changed, 7 insertions, 1 deletions
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