where
-- Check associated pointer file for modifications, and reset if
-- it's unmodified.
- resetpointer file = ifM (isUnmodified key file)
- ( adjustedBranchRefresh (AssociatedFile (Just file)) $
- depopulatePointerFile key file
- -- Modified file, so leave it alone.
- -- If it was a hard link to the annex object,
- -- that object might have been frozen as part of the
- -- removal process, so thaw it.
- , void $ tryIO $ thawContent file
- )
+ resetpointer file = unlessM (liftIO $ isSymbolicLink <$> getSymbolicLinkStatus (fromRawFilePath file)) $
+ ifM (isUnmodified key file)
+ ( adjustedBranchRefresh (AssociatedFile (Just file)) $
+ depopulatePointerFile key file
+ -- Modified file, so leave it alone.
+ -- If it was a hard link to the annex object,
+ -- that object might have been frozen as part of the
+ -- removal process, so thaw it.
+ , void $ tryIO $ thawContent file
+ )
{- Moves a key out of .git/annex/objects/ into .git/annex/bad, and
- returns the file it was moved to. -}
--- /dev/null
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 7"""
+ date="2022-02-24T18:13:20Z"
+ content="""
+ [2022-02-24 13:50:11.885644532] (Annex.Perms) thawing content ./foo
+
+This turns out to be due to removeAnnex's resetpointer.
+It was not intended to run on symlinks. I've fixed this too.
+"""]]