add: Fix reversion when adding an annex link that has been moved to another directory

Fixes commit f259be7f39

Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
Joey Hess 2022-07-05 16:22:41 -04:00
parent 149d12f188
commit 201e41cffd
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 18 additions and 1 deletions

View file

@ -210,7 +210,7 @@ start si file addunlockedmatcher =
starting "add" (ActionItemTreeFile file) si $
addingExistingLink file key $
withOtherTmp $ \tmp -> do
let tmpf = tmp P.</> file
let tmpf = tmp P.</> P.takeFileName file
liftIO $ moveFile file tmpf
ifM (isSymbolicLink <$> liftIO (R.getSymbolicLinkStatus tmpf))
( do