summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-05-03 14:08:26 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-05-03 14:08:26 -0400
commitfbcdb2efc7e6782422b8e87f029f850aa350a901 (patch)
tree62b31fbf621121c60f169bbbcc2292ccde235e4a /Annex
parent1e54cdf735258c7970f4283f0276322dd32a3724 (diff)
work around git/environment/gecos/android suck
I don't know why, but I can't seem to set the environment variables inside git-annex to work around the git error caused by android's crappy username and hostname settings. This workaround works, and that's all that's good about it.
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Environment.hs18
1 files changed, 13 insertions, 5 deletions
diff --git a/Annex/Environment.hs b/Annex/Environment.hs
index 9e5945360..d0cd93c2c 100644
--- a/Annex/Environment.hs
+++ b/Annex/Environment.hs
@@ -5,6 +5,8 @@
- Licensed under the GNU GPL version 3 or higher.
-}
+{-# LANGUAGE CPP #-}
+
module Annex.Environment where
import Common.Annex
@@ -27,8 +29,14 @@ checkEnvironmentIO :: IO ()
checkEnvironmentIO = do
whenM (null <$> myUserGecos) $ do
username <- myUserName
- -- existing environment is not overwritten
- setEnv "GIT_AUTHOR_NAME" username False
- setEnv "GIT_COMMITTER_NAME" username False
- hostname <- getHostName
- setEnv "EMAIL" (username ++ "@" ++ hostname) False
+ ensureEnv "GIT_AUTHOR_NAME" username
+ ensureEnv "GIT_COMMITTER_NAME" username
+ where
+#ifndef __ANDROID__
+ -- existing environment is not overwritten
+ 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