diff options
author | Joey Hess <joey@kitenet.net> | 2013-04-22 15:36:34 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-04-22 15:36:34 -0400 |
commit | 6c5360cbdf20821a97a0f109ea114e4772b001e6 (patch) | |
tree | 030a5613938276edb57e18a09063bfe4c4ed4905 /Assistant | |
parent | 8655ea7f8e853b7de4defbca2655b741362ecd21 (diff) |
Detect systems that have no user name set in GECOS, and also don't have user.name set in git config, and put in a workaround so that commits to the git-annex branch (and the assistant) will still succeed despite git not liking the system configuration.
Diffstat (limited to 'Assistant')
-rw-r--r-- | Assistant/Environment.hs | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/Assistant/Environment.hs b/Assistant/Environment.hs deleted file mode 100644 index 3153fcfe5..000000000 --- a/Assistant/Environment.hs +++ /dev/null @@ -1,26 +0,0 @@ -{- git-annex assistant environment - - - - Copyright 2012 Joey Hess <joey@kitenet.net> - - - - Licensed under the GNU GPL version 3 or higher. - -} - -module Assistant.Environment where - -import Assistant.Common -import Utility.UserInfo -import qualified Git.Config - -import System.Posix.Env - -{- Checks that the system's environment allows git to function. - - Git requires a GECOS username, or suitable git configuration, or - - environment variables. -} -checkEnvironment :: Annex () -checkEnvironment = do - username <- liftIO myUserName - gecos <- liftIO myUserGecos - gitusername <- fromRepo $ Git.Config.getMaybe "user.name" - when (null gecos && (gitusername == Nothing || gitusername == Just "")) $ - -- existing environment is not overwritten - liftIO $ setEnv "GIT_AUTHOR_NAME" username False |