diff options
author | Joey Hess <joey@kitenet.net> | 2014-08-04 09:00:57 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-08-04 09:01:40 -0400 |
commit | f2213b0cb0b21dbbc651b4c869e85d7fd7f839bd (patch) | |
tree | 3963e284c771ffa7e7fb94ce6a185ea53cb3ca9e /Remote/GCrypt.hs | |
parent | 05bbd868072b293022b06354c990f5d8e674c0b6 (diff) |
gcrypt: fix removal of key that does not exist
Generalized code from Remote.Directory and reused it.
Test suite now passes for local gcrypt repos.
Diffstat (limited to 'Remote/GCrypt.hs')
-rw-r--r-- | Remote/GCrypt.hs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/Remote/GCrypt.hs b/Remote/GCrypt.hs index 02c31f38d..a0292a954 100644 --- a/Remote/GCrypt.hs +++ b/Remote/GCrypt.hs @@ -40,6 +40,7 @@ import Utility.Metered import Annex.UUID import Annex.Ssh import qualified Remote.Rsync +import qualified Remote.Directory import Utility.Rsync import Utility.Tmp import Logs.Remote @@ -335,14 +336,8 @@ retrieve r rsyncopts remove :: Remote -> Remote.Rsync.RsyncOpts -> Key -> Annex Bool remove r rsyncopts k - | not $ Git.repoIsUrl (repo r) = guardUsable (repo r) False $ do - let f = gCryptLocation r k - let d = parentDir f - liftIO $ do - allowWrite d - allowWrite f - removeDirectoryRecursive d - return True + | not $ Git.repoIsUrl (repo r) = guardUsable (repo r) False $ + liftIO $ Remote.Directory.removeDirGeneric (Git.repoLocation (repo r)) (parentDir (gCryptLocation r k)) | Git.repoIsSsh (repo r) = shellOrRsync r removeshell removersync | otherwise = unsupportedUrl where |