Better to not have a single function module, and better to have a more
specific type than Bool.

This commit was sponsored by Jack Hill on Patreon
This commit is contained in:
Joey Hess 2019-11-11 18:20:35 -04:00
parent 3b34d123ed
commit 0be23bae2f
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
11 changed files with 23 additions and 44 deletions

View file

@ -21,6 +21,7 @@ import qualified Git.Config
import qualified Git.Construct
import Git.Types
import Git.ConfigTypes
import Git.Branch (CommitMode(..))
import Utility.DataUnits
import Config.Cost
import Types.UUID
@ -105,7 +106,7 @@ data GitConfig = GitConfig
, annexJobs :: Concurrency
, annexCacheCreds :: Bool
, annexAutoUpgradeRepository :: Bool
, annexAllowSign :: Bool
, annexCommitMode :: CommitMode
, coreSymlinks :: Bool
, coreSharedRepository :: SharedRepository
, receiveDenyCurrentBranch :: DenyCurrentBranch
@ -187,7 +188,9 @@ extractGitConfig r = GitConfig
parseConcurrency =<< getmaybe (annex "jobs")
, annexCacheCreds = getbool (annex "cachecreds") True
, annexAutoUpgradeRepository = getbool (annex "autoupgraderepository") True
, annexAllowSign = getbool (annex "allowsign") False
, annexCommitMode = if getbool (annex "allowsign") False
then ManualCommit
else AutomaticCommit
, coreSymlinks = getbool "core.symlinks" True
, coreSharedRepository = getSharedRepository r
, receiveDenyCurrentBranch = getDenyCurrentBranch r