summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-02-25 13:46:31 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-02-25 13:46:31 -0400
commitc5df5fd4fa172782fee20f966b04c3793df140a1 (patch)
tree8f490e8ebb8f3d1fddd4f1427b93e507103c578c /Annex
parent65c51156f44a8e68eb8d3658894c2d5efa871f30 (diff)
refactor
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Index.hs29
-rw-r--r--Annex/Ssh.hs2
2 files changed, 3 insertions, 28 deletions
diff --git a/Annex/Index.hs b/Annex/Index.hs
index ee27ce5f6..b3323ff3a 100644
--- a/Annex/Index.hs
+++ b/Annex/Index.hs
@@ -5,19 +5,14 @@
- Licensed under the GNU GPL version 3 or higher.
-}
-{-# LANGUAGE CPP #-}
-
-module Annex.Index (
- withIndexFile,
- addGitEnv,
-) where
+module Annex.Index (withIndexFile) where
import qualified Control.Exception as E
import Annex.Common
import Git.Types
+import Git.Env
import qualified Annex
-import Utility.Env
{- Runs an action using a different git index file. -}
withIndexFile :: FilePath -> Annex a -> Annex a
@@ -30,23 +25,3 @@ withIndexFile f a = do
a
Annex.changeState $ \s -> s { Annex.repo = (Annex.repo s) { gitEnv = gitEnv g} }
either E.throw return r
-
-addGitEnv :: Repo -> String -> String -> IO Repo
-addGitEnv g var val = do
- e <- maybe copyenv return (gitEnv g)
- let e' = addEntry var val e
- return $ g { gitEnv = Just e' }
- where
- copyenv = do
-#ifdef __ANDROID__
- {- This should not be necessary on Android, but there is some
- - weird getEnvironment breakage. See
- - https://github.com/neurocyte/ghc-android/issues/7
- - Use getEnv to get some key environment variables that
- - git expects to have. -}
- let keyenv = words "USER PATH GIT_EXEC_PATH HOSTNAME HOME"
- let getEnvPair k = maybe Nothing (\v -> Just (k, v)) <$> getEnv k
- liftIO $ catMaybes <$> forM keyenv getEnvPair
-#else
- liftIO getEnvironment
-#endif
diff --git a/Annex/Ssh.hs b/Annex/Ssh.hs
index 5c6a9dcea..a97134c79 100644
--- a/Annex/Ssh.hs
+++ b/Annex/Ssh.hs
@@ -34,7 +34,7 @@ import Config
import Annex.Path
import Utility.Env
import Types.CleanupActions
-import Annex.Index (addGitEnv)
+import Git.Env
#ifndef mingw32_HOST_OS
import Annex.Perms
import Annex.LockPool