+git-annex (8.20211232) UNRELEASED; urgency=medium
+
+ * export: When a non-annexed symlink is in the tree to be exported, skip it.
+ * import: When the previously exported tree contained a non-annexed symlink,
+ preserve it in the imported tree so it does not get deleted.
+
+ -- Joey Hess <id@joeyh.name> Mon, 03 Jan 2022 14:01:14 -0400
+
git-annex (8.20211231) upstream; urgency=medium
* Improved support for using git-annex in a read-only repository,
newtype ExportFiltered t = ExportFiltered t
-- | Filters the tree to annexed files that are preferred content of the
--- remote, and also including non-annexed files, but not submodules.
+-- remote, and also including non-annexed files, but not submodules or
+-- non-annexed symlinks.
--
-- A log is written with tree items that were filtered out, so they can
-- be added back in when importing from the remote.
case toTreeItemType mode of
-- Don't export submodule entries.
Just TreeSubmodule -> excluded
- _ -> case mmatcher of
- Nothing -> return (Just ti)
- Just matcher -> catKey sha >>= \case
- Just k -> checkmatcher matcher k
- -- Always export non-annexed files.
- Nothing -> return (Just ti)
+ Just TreeSymlink -> checkkey True
+ _ -> checkkey False
where
excluded = do
() <- liftIO $ logwriter ti
return Nothing
+ checkkey issymlink =
+ case mmatcher of
+ Nothing
+ | issymlink -> catKey sha >>= \case
+ Just _ -> return (Just ti)
+ Nothing
+ | issymlink -> excluded
+ | otherwise -> return (Just ti)
+ | otherwise -> return (Just ti)
+ Just matcher -> catKey sha >>= \case
+ Just k -> checkmatcher matcher k
+ Nothing
+ | issymlink -> excluded
+ | otherwise -> return (Just ti)
+
checkmatcher matcher k = do
let mi = MatchingInfo $ ProvidedInfo
{ providedFilePath = Just $