all commands building except for assistant

also, changed ConfigValue to a newtype, and moved it into Git.Config.
This commit is contained in:
Joey Hess 2019-12-05 14:36:43 -04:00
parent 718fa83da6
commit c20f4704a7
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
40 changed files with 187 additions and 174 deletions

View file

@ -16,7 +16,7 @@ import Annex.Common
import qualified Annex
import Types.Remote
import Types.Creds
import Git.Types (fromConfigKey)
import Git.Types (ConfigValue(..), fromConfigKey)
import qualified Git
import qualified Git.Command
import qualified Git.Config
@ -213,7 +213,7 @@ storeBupUUID u buprepo = do
giveup "ssh failed"
else liftIO $ do
r' <- Git.Config.read r
let olduuid = Git.Config.get configkeyUUID mempty r'
let ConfigValue olduuid = Git.Config.get configkeyUUID mempty r'
when (S.null olduuid) $
Git.Command.run
[ Param "config"

View file

@ -30,7 +30,7 @@ import Types.GitConfig
import Types.Crypto
import Types.Creds
import Types.Transfer
import Git.Types (ConfigKey(..), fromConfigKey)
import Git.Types (ConfigKey(..), fromConfigKey, fromConfigValue)
import qualified Git
import qualified Git.Command
import qualified Git.Config
@ -462,7 +462,7 @@ getGCryptId fast r gc
| otherwise = return (Nothing, r)
where
extract Nothing = (Nothing, r)
extract (Just r') = (decodeBS' <$> Git.Config.getMaybe coreGCryptId r', r')
extract (Just r') = (fromConfigValue <$> Git.Config.getMaybe coreGCryptId r', r')
getConfigViaRsync :: Git.Repo -> RemoteGitConfig -> Annex (Either SomeException (Git.Repo, S.ByteString))
getConfigViaRsync r gc = do

View file

@ -95,7 +95,7 @@ list autoinit = do
Nothing -> return r
Just url -> inRepo $ \g ->
Git.Construct.remoteNamed n $
Git.Construct.fromRemoteLocation (decodeBS' url) g
Git.Construct.fromRemoteLocation (Git.fromConfigValue url) g
{- Git remotes are normally set up using standard git command, not
- git-annex initremote and enableremote.

View file

@ -189,7 +189,7 @@ configKnownUrl r
set k v r' = do
let k' = remoteConfig r' k
setConfig k' v
return $ Git.Config.store' k' (encodeBS' v) r'
return $ Git.Config.store' k' (Git.ConfigValue (encodeBS' v)) r'
data LFSHandle = LFSHandle
{ downloadEndpoint :: Maybe LFS.Endpoint

View file

@ -11,7 +11,7 @@ import Annex.Common
import Types.Remote
import Types.Creds
import qualified Git
import Git.Types (fromConfigKey)
import Git.Types (fromConfigKey, fromConfigValue)
import Config
import Config.Cost
import Annex.UUID
@ -108,10 +108,10 @@ hookEnv action k f = Just <$> mergeenv (fileenv f ++ keyenv)
lookupHook :: HookName -> Action -> Annex (Maybe String)
lookupHook hookname action = do
command <- decodeBS' <$> getConfig hook mempty
command <- fromConfigValue <$> getConfig hook mempty
if null command
then do
fallback <- decodeBS' <$> getConfig hookfallback mempty
fallback <- fromConfigValue <$> getConfig hookfallback mempty
if null fallback
then do
warning $ "missing configuration for " ++ fromConfigKey hook ++ " or " ++ fromConfigKey hookfallback