avoid writing same symlink twice in a row

Oddly, the second write did not cause it to lose the mtime inherited
from the file being added, although the mtime was not provided to that
write but only to the first. I don't quite know why that worked before!
This commit is contained in:
Joey Hess 2022-06-14 14:30:12 -04:00
parent 64c7f60f7a
commit 7ace804d8e
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -341,8 +341,8 @@ addLink ci file key mcache = ifM (coreSymlinks <$> Annex.getGitConfig)
addSymlink :: RawFilePath -> Key -> Maybe InodeCache -> Annex ()
addSymlink file key mcache = do
l <- makeLink file key mcache
addAnnexLink l file
linktarget <- makeLink file key mcache
stageSymlink file =<< hashSymlink linktarget
{- Parameters to pass to git add, forcing addition of ignored files.
-