fix removal from local gcrypt repo that had files stored using rsync

When files are stored using rsync, they have their write bit removed;
so does the directory they're put in. The local repo code did not turn
these bits back on, so failed to remove.
This commit is contained in:
Joey Hess 2014-08-03 20:21:46 -04:00
parent 8601f8f571
commit d12becfdde
2 changed files with 7 additions and 2 deletions

View file

@ -45,6 +45,7 @@ import Utility.Tmp
import Logs.Remote
import Logs.Transfer
import Utility.Gpg
import Utility.FileMode
remote :: RemoteType
remote = RemoteType {
@ -325,7 +326,12 @@ 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
liftIO $ removeDirectoryRecursive $ parentDir $ gCryptLocation r k
let f = gCryptLocation r k
let d = parentDir f
liftIO $ do
allowWrite d
allowWrite f
removeDirectoryRecursive d
return True
| Git.repoIsSsh (repo r) = shellOrRsync r removeshell removersync
| otherwise = unsupportedUrl