diff --git a/CHANGELOG b/CHANGELOG index a6219672c1..6a8790b090 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -13,10 +13,10 @@ git-annex (10.20220526) UNRELEASED; urgency=medium content, but where dropping failed due to eg a network problem, in cases where numcopies checks prevented the resumed move from dropping the object from the source repository. - * add: When several files are being added, replacing an annex symlink + * add, fix: When several files are being added, replacing an annex symlink of a file that was already processed with a new large file could - sometimes cause that large file to be added to git. This race has been - fixed. + sometimes cause that large file to be added to git. + These races have been fixed. * add --batch: Fix handling of a file that is skipped due to being gitignored. diff --git a/Command/Fix.hs b/Command/Fix.hs index 581cb7ced2..59b3a15289 100644 --- a/Command/Fix.hs +++ b/Command/Fix.hs @@ -15,7 +15,7 @@ import qualified Annex import Annex.ReplaceFile import Annex.Content import Annex.Perms -import qualified Annex.Queue +import Annex.Link import qualified Database.Keys import qualified Utility.RawFilePath as R @@ -103,9 +103,5 @@ fixSymlink file link = do #if ! defined(mingw32_HOST_OS) liftIO $ maybe noop (\t -> touch file t False) mtime #endif - next $ cleanupSymlink (fromRawFilePath file) - -cleanupSymlink :: FilePath -> CommandCleanup -cleanupSymlink file = do - Annex.Queue.addCommand [] "add" [Param "--force", Param "--"] [file] - return True + stageSymlink file =<< hashSymlink link + next $ return True