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

@ -12,6 +12,7 @@ import Annex.UUID
import Annex.Init
import qualified Annex.Branch
import qualified Git.Config
import Git.Types
import Remote.GCrypt (coreGCryptId)
import qualified CmdLine.GitAnnexShell.Fields as Fields
import CmdLine.GitAnnexShell.Checks
@ -28,11 +29,12 @@ seek = withNothing (commandAction start)
start :: CommandStart
start = do
u <- findOrGenUUID
showConfig "annex.uuid" $ fromUUID u
showConfig coreGCryptId =<< fromRepo (Git.Config.get coreGCryptId "")
showConfig configkeyUUID $ fromUUID u
showConfig coreGCryptId . decodeBS'
=<< fromRepo (Git.Config.get coreGCryptId mempty)
stop
where
showConfig k v = liftIO $ putStrLn $ k ++ "=" ++ v
showConfig k v = liftIO $ putStrLn $ fromConfigKey k ++ "=" ++ v
{- The repository may not yet have a UUID; automatically initialize it
- when there's a git-annex branch available or if the autoinit field was

View file

@ -46,7 +46,8 @@ start key = do
fieldTransfer :: Direction -> Key -> (MeterUpdate -> Annex Bool) -> CommandStart
fieldTransfer direction key a = do
liftIO $ debugM "fieldTransfer" "transfer start"
afile <- AssociatedFile <$> Fields.getField Fields.associatedFile
afile <- AssociatedFile . (fmap toRawFilePath)
<$> Fields.getField Fields.associatedFile
ok <- maybe (a $ const noop)
-- Using noRetry here because we're the sender.
(\u -> runner (Transfer direction (toUUID u) (fromKey id key)) afile noRetry a)

View file

@ -41,7 +41,8 @@ start (k:[]) = do
case deserializeKey k of
Nothing -> error "bad key"
(Just key) -> whenM (inAnnex key) $ do
afile <- AssociatedFile <$> Fields.getField Fields.associatedFile
afile <- AssociatedFile . (fmap toRawFilePath)
<$> Fields.getField Fields.associatedFile
u <- maybe (error "missing remoteuuid") toUUID
<$> Fields.getField Fields.remoteUUID
let t = Transfer