import Data.Default in Common

This commit is contained in:
Joey Hess 2015-01-28 16:11:28 -04:00
parent 0fd5f257d0
commit e8c376e0ad
19 changed files with 48 additions and 54 deletions

View file

@ -98,7 +98,7 @@ extractGitConfig r = GitConfig
, annexDifferences = getDifferences r
}
where
getbool k def = fromMaybe def $ getmaybebool k
getbool k d = fromMaybe d $ getmaybebool k
getmaybebool k = Git.Config.isTrue =<< getmaybe k
getmayberead k = readish =<< getmaybe k
getmaybe k = Git.Config.getMaybe k r
@ -178,7 +178,7 @@ extractRemoteGitConfig r remotename = RemoteGitConfig
, remoteGitConfig = Nothing
}
where
getbool k def = fromMaybe def $ getmaybebool k
getbool k d = fromMaybe d $ getmaybebool k
getmaybebool k = Git.Config.isTrue =<< getmaybe k
getmayberead k = readish =<< getmaybe k
getmaybe k = mplus (Git.Config.getMaybe (key k) r)