summaryrefslogtreecommitdiff
path: root/Annex/Environment.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-10-15 20:33:52 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-10-15 20:33:52 -0400
commita87f9b63077c8b93f4b2284d494c0081bd938f8d (patch)
treed56e424b73aecfca32f24b637fcc0dcc2050adce /Annex/Environment.hs
parent10ff3282ee60cc41ad9d9ac71a99eea7053cebaa (diff)
Use haskell setenv library to clean up several ugly workarounds for inability to manipulate the environment on windows.
Didn't know that this library existed! This includes making git-annex not re-exec itself on start on windows, and making the test suite on Windows run tests without forking.
Diffstat (limited to 'Annex/Environment.hs')
-rw-r--r--Annex/Environment.hs15
1 files changed, 5 insertions, 10 deletions
diff --git a/Annex/Environment.hs b/Annex/Environment.hs
index b1b5e96e9..a580c0ed1 100644
--- a/Annex/Environment.hs
+++ b/Annex/Environment.hs
@@ -35,24 +35,19 @@ checkEnvironment = do
liftIO checkEnvironmentIO
checkEnvironmentIO :: IO ()
-checkEnvironmentIO =
-#ifdef mingw32_HOST_OS
- noop
-#else
- whenM (null <$> myUserGecos) $ do
- username <- myUserName
- ensureEnv "GIT_AUTHOR_NAME" username
- ensureEnv "GIT_COMMITTER_NAME" username
+checkEnvironmentIO = whenM (null <$> myUserGecos) $ do
+ username <- myUserName
+ ensureEnv "GIT_AUTHOR_NAME" username
+ ensureEnv "GIT_COMMITTER_NAME" username
where
#ifndef __ANDROID__
-- existing environment is not overwritten
- ensureEnv var val = void $ setEnv var val False
+ ensureEnv var val = setEnv var val False
#else
-- Environment setting is broken on Android, so this is dealt with
-- in runshell instead.
ensureEnv _ _ = noop
#endif
-#endif
{- Runs an action that commits to the repository, and if it fails,
- sets user.email and user.name to a dummy value and tries the action again. -}