From 7ed6a5520cee91fc9ccd6105e938a3dd7b88dca0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 20 Apr 2014 14:17:57 -0400 Subject: When init detects that git is not configured to commit, and sets user.email to work around the problem, also make it set user.name. I was able to reproduce git failing to commit despite user.email being set, in a test account on my laptop. The account had no GECOS information. --- Annex/Environment.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Annex/Environment.hs') diff --git a/Annex/Environment.hs b/Annex/Environment.hs index f22c5f2d4..4b8d38464 100644 --- a/Annex/Environment.hs +++ b/Annex/Environment.hs @@ -56,10 +56,12 @@ checkEnvironmentIO = #endif {- Runs an action that commits to the repository, and if it fails, - - sets user.email to a dummy value and tries the action again. -} + - sets user.email and user.name to a dummy value and tries the action again. -} ensureCommit :: Annex a -> Annex a ensureCommit a = either retry return =<< tryAnnex a where retry _ = do - setConfig (ConfigKey "user.email") =<< liftIO myUserName + name <- liftIO myUserName + setConfig (ConfigKey "user.name") name + setConfig (ConfigKey "user.email") name a -- cgit v1.2.3