git-annex config: guard against non-repo-global configs
git-annex config: Only allow configs be set that are ones git-annex actually supports reading from repo-global config, to avoid confused users trying to set other configs with this.
This commit is contained in:
parent
5a72e3be18
commit
ccd8c43dc8
8 changed files with 136 additions and 110 deletions
|
@ -16,7 +16,7 @@ import Types
|
|||
import Types.UUID
|
||||
import Types.ProposedAccepted
|
||||
import Types.RemoteConfig
|
||||
import Config
|
||||
import Types.GitConfig
|
||||
import qualified Git.Config
|
||||
|
||||
import qualified Data.Map as M
|
||||
|
@ -234,8 +234,12 @@ optionalStringParser f fielddesc = RemoteConfigFieldParser
|
|||
p Nothing _c = Right Nothing
|
||||
|
||||
yesNoParser :: RemoteConfigField -> Bool -> FieldDesc -> RemoteConfigFieldParser
|
||||
yesNoParser f v fd = genParser yesNo f v fd
|
||||
yesNoParser f v fd = genParser yesno f v fd
|
||||
(Just (ValueDesc "yes or no"))
|
||||
where
|
||||
yesno "yes" = Just True
|
||||
yesno "no" = Just False
|
||||
yesno _ = Nothing
|
||||
|
||||
trueFalseParser :: RemoteConfigField -> Bool -> FieldDesc -> RemoteConfigFieldParser
|
||||
trueFalseParser f v fd = genParser Git.Config.isTrueFalse f v fd
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue