* S3: Allow setting publicurl=yes without public=yes, to support
buckets that are configured with a Bucket Policy that allows public
access.
- * directory: Remove empty hash directories when dropping content.
+ * directory, gcrypt: Remove empty hash directories when dropping content.
* dropunused: Support --jobs
-- Joey Hess <id@joeyh.name> Mon, 26 Jun 2023 13:10:40 -0400
remove' :: Git.Repo -> Remote -> Remote.Rsync.RsyncOpts -> AccessMethod -> Remover
remove' repo r rsyncopts accessmethod k
| not $ Git.repoIsUrl repo = guardUsable repo (giveup "cannot access remote") $
- liftIO $ Remote.Directory.removeDirGeneric False
- (fromRawFilePath (Git.repoPath repo))
+ liftIO $ Remote.Directory.removeDirGeneric True
+ (gCryptTopDir repo)
(fromRawFilePath (parentDir (toRawFilePath (gCryptLocation repo k))))
| Git.repoIsSsh repo = shellOrRsync r removeshell removersync
| accessmethod == AccessRsyncOverSsh = removersync
checkrsync = Remote.Rsync.checkKey rsyncopts k
checkshell = Ssh.inAnnex repo k
+gCryptTopDir :: Git.Repo -> FilePath
+gCryptTopDir repo = Git.repoLocation repo </> fromRawFilePath objectDir
+
{- Annexed objects are hashed using lower-case directories for max
- portability. -}
gCryptLocation :: Git.Repo -> Key -> FilePath
-gCryptLocation repo key = Git.repoLocation repo </> fromRawFilePath objectDir
+gCryptLocation repo key = gCryptTopDir repo
</> fromRawFilePath (keyPath key (hashDirLower def))
data AccessMethod = AccessRsyncOverSsh | AccessGitAnnexShell