From 339aebc6adfc7946e408cf8aef8d0c424dff323a Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Mon, 23 Mar 2020 15:45:15 -0400 Subject: [PATCH] add --force-small: Don't dereference link when checking file status addSmallOverridden calls getFileStatus and then checks the result with isSymbolicLink. getFileStatus dereferences symbolic links, so isSymbolicLink will always return false (assuming the getFileStatus call doesn't fail on a broken link). Use getSymbolicLinkStatus instead. --- Command/Add.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Command/Add.hs b/Command/Add.hs index e142aac0bc..56e6fb2361 100644 --- a/Command/Add.hs +++ b/Command/Add.hs @@ -107,7 +107,7 @@ addSmallOverridden :: RawFilePath -> Annex Bool addSmallOverridden file = do showNote "adding content to git repository" let file' = fromRawFilePath file - s <- liftIO $ getFileStatus file' + s <- liftIO $ getSymbolicLinkStatus file' if isSymbolicLink s then addFile file else do