summaryrefslogtreecommitdiff
path: root/Git
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2014-10-26 13:39:44 -0400
committerJoey Hess <joey@kitenet.net>2014-10-26 13:39:44 -0400
commit10fa4567bd1761a1e26b841128aff9781e7e0df3 (patch)
tree85348a0a299c7d9b6e83b29e31801a4e2f764b89 /Git
parentea95774b41eb09c8b49ae8c2c66db7bf8e68ac26 (diff)
downloadgit-repair-10fa4567bd1761a1e26b841128aff9781e7e0df3.tar.gz
setenv for windowsdebian/1.201410261.20141026
Diffstat (limited to 'Git')
-rw-r--r--Git/CurrentRepo.hs10
-rw-r--r--Git/Index.hs4
2 files changed, 3 insertions, 11 deletions
diff --git a/Git/CurrentRepo.hs b/Git/CurrentRepo.hs
index 23ebbbc..f611f7a 100644
--- a/Git/CurrentRepo.hs
+++ b/Git/CurrentRepo.hs
@@ -5,17 +5,13 @@
- Licensed under the GNU GPL version 3 or higher.
-}
-{-# LANGUAGE CPP #-}
-
module Git.CurrentRepo where
import Common
import Git.Types
import Git.Construct
import qualified Git.Config
-#ifndef mingw32_HOST_OS
import Utility.Env
-#endif
{- Gets the current git repository.
-
@@ -42,17 +38,13 @@ get = do
setCurrentDirectory d
return $ addworktree wt r
where
-#ifndef mingw32_HOST_OS
pathenv s = do
v <- getEnv s
case v of
Just d -> do
- void $ unsetEnv s
+ unsetEnv s
Just <$> absPath d
Nothing -> return Nothing
-#else
- pathenv _ = return Nothing
-#endif
configure Nothing (Just r) = Git.Config.read r
configure (Just d) _ = do
diff --git a/Git/Index.hs b/Git/Index.hs
index d712245..c42ac42 100644
--- a/Git/Index.hs
+++ b/Git/Index.hs
@@ -21,8 +21,8 @@ import Utility.Env
override :: FilePath -> IO (IO ())
override index = do
res <- getEnv var
- void $ setEnv var index True
- return $ void $ reset res
+ setEnv var index True
+ return $ reset res
where
var = "GIT_INDEX_FILE"
reset (Just v) = setEnv var v True