From a87f9b63077c8b93f4b2284d494c0081bd938f8d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 15 Oct 2014 20:33:52 -0400 Subject: 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. --- Annex/Environment.hs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'Annex/Environment.hs') 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. -} -- cgit v1.2.3