support boolean git configs that are represented by the name of the setting with no value
Eg"core.bare" is the same as "core.bare = true". Note that git treats "core.bare =" the same as "core.bare = false", so the code had to become more complicated in order to treat the absense of a value differently than an empty value. Ugh.
This commit is contained in:
parent
ca9c6c5f60
commit
9cb69dbb76
8 changed files with 35 additions and 7 deletions
|
@ -23,7 +23,6 @@ data SharedRepository = UnShared | GroupShared | AllShared | UmaskShared Int
|
|||
getSharedRepository :: Repo -> SharedRepository
|
||||
getSharedRepository r =
|
||||
case Git.Config.getMaybe "core.sharedrepository" r of
|
||||
Nothing -> UnShared
|
||||
Just (ConfigValue v) -> case S8.map toLower v of
|
||||
"1" -> GroupShared
|
||||
"2" -> AllShared
|
||||
|
@ -33,6 +32,8 @@ getSharedRepository r =
|
|||
"world" -> AllShared
|
||||
"everybody" -> AllShared
|
||||
_ -> maybe UnShared UmaskShared (readish (decodeBS' v))
|
||||
Just NoConfigValue -> UnShared
|
||||
Nothing -> UnShared
|
||||
|
||||
data DenyCurrentBranch = UpdateInstead | RefusePush | WarnPush | IgnorePush
|
||||
deriving (Eq)
|
||||
|
@ -45,4 +46,5 @@ getDenyCurrentBranch r =
|
|||
"warn" -> WarnPush
|
||||
"ignore" -> IgnorePush
|
||||
_ -> RefusePush
|
||||
Just NoConfigValue -> RefusePush
|
||||
Nothing -> RefusePush
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue