aboutsummaryrefslogtreecommitdiff
path: root/Git.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-02-25 19:15:29 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-02-25 19:15:29 -0400
commit12b89a3eb81fdac92ec3ea9633bbd9a7d6a72adb (patch)
treeea35600752cf95dab1522257ee722d29b39fee27 /Git.hs
parentc3fbe07d7ad03944d0967ebfa2b8f65cbc2ad5dc (diff)
configure: Check if ssh connection caching is supported by the installed version of ssh and default annex.sshcaching accordingly.
Diffstat (limited to 'Git.hs')
-rw-r--r--Git.hs12
1 files changed, 9 insertions, 3 deletions
diff --git a/Git.hs b/Git.hs
index d8db471e9..284bf331c 100644
--- a/Git.hs
+++ b/Git.hs
@@ -85,7 +85,8 @@ assertLocal repo action =
else error $ "acting on non-local git repo " ++ repoDescribe repo ++
" not supported"
configBare :: Repo -> Bool
-configBare repo = maybe unknown configTrue $ M.lookup "core.bare" $ config repo
+configBare repo = maybe unknown (fromMaybe False . configTrue) $
+ M.lookup "core.bare" $ config repo
where
unknown = error $ "it is not known if git repo " ++
repoDescribe repo ++
@@ -112,5 +113,10 @@ workTree Repo { location = Dir d } = d
workTree Repo { location = Unknown } = undefined
{- Checks if a string from git config is a true value. -}
-configTrue :: String -> Bool
-configTrue s = map toLower s == "true"
+configTrue :: String -> Maybe Bool
+configTrue s
+ | s' == "true" = Just True
+ | s' == "false" = Just False
+ | otherwise = Nothing
+ where
+ s' = map toLower s