From 7ace804d8e287432c4c77f27e2a792bad0b90cd5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 14 Jun 2022 14:30:12 -0400 Subject: [PATCH] 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! --- Annex/Ingest.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Annex/Ingest.hs b/Annex/Ingest.hs index 90b2d6dbef..da9d4b5ae4 100644 --- a/Annex/Ingest.hs +++ b/Annex/Ingest.hs @@ -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. -