{- git-annex environment
-
- - Copyright 2012-2023 Joey Hess <id@joeyh.name>
+ - Copyright 2012, 2013 Joey Hess <id@joeyh.name>
-
- Licensed under the GNU AGPL version 3 or higher.
-}
) where
import Annex.Common
-import qualified Annex
import Utility.UserInfo
import qualified Git.Config
+import Config
import Utility.Env.Set
import Control.Exception
ensureEnv var val = setEnv var val False
{- Runs an action that commits to the repository, and if it fails,
- - overrides user.email and user.name to a dummy value and tries
- - the action again. -}
+ - sets user.email and user.name to a dummy value and tries the action again.
+ -
+ - Note that user.email and user.name are left set afterwards, so this only
+ - needs to be used once to make sure that future commits will succeed.
+ -}
ensureCommit :: Annex a -> Annex a
ensureCommit a = either retry return =<< tryNonAsync a
where
( liftIO (throwIO e)
, do
name <- liftIO $ either (const "unknown") id <$> myUserName
- Annex.addGitConfigOverride ("user.name=" ++ name)
- Annex.addGitConfigOverride ("user.email=" ++ name)
+ setConfig "user.name" name
+ setConfig "user.email" name
a
)
* Sped up sqlite inserts 2x when built with persistent 2.14.5.0
* Fix laziness bug introduced in last release that breaks use
of --unlock-present and --hide-missing adjusted branches.
- * Avoid setting user.name and user.email in the git config
- when git is unable to detect them.
* Support user.useConfigOnly git config.
-- Joey Hess <id@joeyh.name> Fri, 31 Mar 2023 12:48:54 -0400