include git-annex-shell back in

Also pushed ConfigKey down into the Git modules, which is the bulk of
the changes.
This commit is contained in:
Joey Hess 2019-12-02 10:57:09 -04:00
parent 65b88a0b99
commit f3047d7186
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
26 changed files with 101 additions and 82 deletions

View file

@ -27,18 +27,13 @@ import qualified Data.ByteString as S
type UnqualifiedConfigKey = S.ByteString
newtype ConfigKey = ConfigKey S.ByteString
instance Show ConfigKey where
show (ConfigKey s) = decodeBS' s
{- Looks up a setting in git config. This is not as efficient as using the
- GitConfig type. -}
getConfig :: ConfigKey -> S.ByteString -> Annex S.ByteString
getConfig (ConfigKey key) d = fromRepo $ Git.Config.get key d
getConfig key d = fromRepo $ Git.Config.get key d
getConfigMaybe :: ConfigKey -> Annex (Maybe S.ByteString)
getConfigMaybe (ConfigKey key) = fromRepo $ Git.Config.getMaybe key
getConfigMaybe key = fromRepo $ Git.Config.getMaybe key
{- Changes a git config setting in both internal state and .git/config -}
setConfig :: ConfigKey -> String -> Annex ()
@ -55,7 +50,7 @@ reloadConfig = Annex.changeGitRepo =<< inRepo Git.Config.reRead
{- Unsets a git config setting. (Leaves it in state.) -}
unsetConfig :: ConfigKey -> Annex ()
unsetConfig (ConfigKey key) = void $ inRepo $ Git.Config.unset key
unsetConfig key = void $ inRepo $ Git.Config.unset key
class RemoteNameable r where
getRemoteName :: r -> RemoteName