Merge branch 'master' into sqlite

This commit is contained in:
Joey Hess 2019-12-26 15:15:42 -04:00
commit 2b821eb225
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
43 changed files with 748 additions and 248 deletions

View file

@ -137,7 +137,7 @@ applyCommitModeForCommitTree :: CommitMode -> [CommandParam] -> Repo -> [Command
applyCommitModeForCommitTree commitmode ps r
| commitmode == ManualCommit =
case Git.Config.getMaybe "commit.gpgsign" r of
Just s | Git.Config.isTrue' s == Just True ->
Just s | Git.Config.isTrueFalse' s == Just True ->
Param "-S":ps
_ -> ps'
| otherwise = ps'

View file

@ -156,12 +156,12 @@ parse s
. map (\(k,v) -> (ConfigKey k, [ConfigValue (S.drop 1 v)]))
. map (S.break (== c))
{- Checks if a string from git config is a true value. -}
isTrue :: String -> Maybe Bool
isTrue = isTrue' . ConfigValue . encodeBS'
{- Checks if a string from git config is a true/false value. -}
isTrueFalse :: String -> Maybe Bool
isTrueFalse = isTrueFalse' . ConfigValue . encodeBS'
isTrue' :: ConfigValue -> Maybe Bool
isTrue' (ConfigValue s)
isTrueFalse' :: ConfigValue -> Maybe Bool
isTrueFalse' (ConfigValue s)
| s' == "true" = Just True
| s' == "false" = Just False
| otherwise = Nothing
@ -177,7 +177,7 @@ boolConfig' True = "true"
boolConfig' False = "false"
isBare :: Repo -> Bool
isBare r = fromMaybe False $ isTrue' =<< getMaybe coreBare r
isBare r = fromMaybe False $ isTrueFalse' =<< getMaybe coreBare r
coreBare :: ConfigKey
coreBare = "core.bare"