set EMAIL when GECOS workaround is needed
Git fails on Android, because it gets some weird domain for local host like "localhost.(none)". This works around that. I made it always set EMAIL when GECOS workaround was needed (unless EMAIL is already set). It might be nicer to try to get the hostname.domain as git does, and only set it if that fails. But I don't want to be stuck trying to exactly duplicate whatever git is doing.
This commit is contained in:
parent
cdddc58365
commit
e23a7598e2
1 changed files with 4 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
||||||
{- git-annex environment
|
{- git-annex environment
|
||||||
-
|
-
|
||||||
- Copyright 2012 Joey Hess <joey@kitenet.net>
|
- Copyright 2012, 2013 Joey Hess <joey@kitenet.net>
|
||||||
-
|
-
|
||||||
- Licensed under the GNU GPL version 3 or higher.
|
- Licensed under the GNU GPL version 3 or higher.
|
||||||
-}
|
-}
|
||||||
|
@ -12,6 +12,7 @@ import Utility.UserInfo
|
||||||
import qualified Git.Config
|
import qualified Git.Config
|
||||||
|
|
||||||
import System.Posix.Env
|
import System.Posix.Env
|
||||||
|
import Network.BSD
|
||||||
|
|
||||||
{- Checks that the system's environment allows git to function.
|
{- Checks that the system's environment allows git to function.
|
||||||
- Git requires a GECOS username, or suitable git configuration, or
|
- Git requires a GECOS username, or suitable git configuration, or
|
||||||
|
@ -29,3 +30,5 @@ checkEnvironmentIO = do
|
||||||
-- existing environment is not overwritten
|
-- existing environment is not overwritten
|
||||||
setEnv "GIT_AUTHOR_NAME" username False
|
setEnv "GIT_AUTHOR_NAME" username False
|
||||||
setEnv "GIT_COMMITTER_NAME" username False
|
setEnv "GIT_COMMITTER_NAME" username False
|
||||||
|
hostname <- getHostName
|
||||||
|
setEnv "EMAIL" (username ++ "@" ++ hostname) False
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue