diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-08-17 12:26:14 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-08-17 13:54:14 -0400 |
commit | da0a1360d7b57d034620338996552752ab873045 (patch) | |
tree | 7cd5d994f15ae0d52e18321a129360b9e39a6d7d /Remote/GCrypt.hs | |
parent | 13ce429b5cbc3036e24613ce85e17af7acd9a480 (diff) |
add annex-ignore-command and annex-sync-command configs
Added remote configuration settings annex-ignore-command and
annex-sync-command, which are dynamic equivilants of the annex-ignore
and annex-sync configurations.
For this I needed a new DynamicConfig infrastructure. Its implementation
should be as fast as before when there is no dynamic config, and it caches
so shell commands are only run once.
Note that annex-ignore-command exits nonzero when the remote should be ignored.
While that may seem backwards, it allows using the same command for it as
for annex-sync-command when you want to disable both.
This commit was sponsored by Trenton Cronholm on Patreon.
Diffstat (limited to 'Remote/GCrypt.hs')
-rw-r--r-- | Remote/GCrypt.hs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Remote/GCrypt.hs b/Remote/GCrypt.hs index ba28a7728..ee949ea08 100644 --- a/Remote/GCrypt.hs +++ b/Remote/GCrypt.hs @@ -227,7 +227,8 @@ gCryptSetup _ mu _ c gc = go $ M.lookup "gitrepo" c setupRepo :: Git.GCrypt.GCryptId -> Git.Repo -> Annex AccessMethod setupRepo gcryptid r | Git.repoIsUrl r = do - (_, _, accessmethod) <- rsyncTransport r def + dummycfg <- liftIO dummyRemoteGitConfig + (_, _, accessmethod) <- rsyncTransport r dummycfg case accessmethod of AccessDirect -> rsyncsetup AccessShell -> ifM gitannexshellsetup @@ -249,7 +250,8 @@ setupRepo gcryptid r -} rsyncsetup = Remote.Rsync.withRsyncScratchDir $ \tmp -> do liftIO $ createDirectoryIfMissing True $ tmp </> objectDir - (rsynctransport, rsyncurl, _) <- rsyncTransport r def + dummycfg <- liftIO dummyRemoteGitConfig + (rsynctransport, rsyncurl, _) <- rsyncTransport r dummycfg let tmpconfig = tmp </> "config" void $ liftIO $ rsync $ rsynctransport ++ [ Param $ rsyncurl ++ "/config" @@ -389,8 +391,10 @@ toAccessMethod "shell" = AccessShell toAccessMethod _ = AccessDirect getGCryptUUID :: Bool -> Git.Repo -> Annex (Maybe UUID) -getGCryptUUID fast r = (genUUIDInNameSpace gCryptNameSpace <$>) . fst - <$> getGCryptId fast r def +getGCryptUUID fast r = do + dummycfg <- liftIO dummyRemoteGitConfig + (genUUIDInNameSpace gCryptNameSpace <$>) . fst + <$> getGCryptId fast r dummycfg coreGCryptId :: String coreGCryptId = "core.gcrypt-id" |