From: Kyle Meyer Date: Mon, 23 Mar 2020 19:45:15 +0000 (-0400) Subject: add --force-small: Send all non-regular files through addFile X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~1^2~122^2~29 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=39131b55ca86444999619d3e5689af9a78d1161d;p=git-annex.git add --force-small: Send all non-regular files through addFile Running `git annex add --force-small` on a modified submodule fails when the submodule path is fed to hash-object. This failure is unlikely to be triggered by a caller passing a submodule explicitly to `git annex add` because there's nothing useful that annex-add can do with a submodule. A more likely scenario for hitting this failure is that the caller passes "." or a subdirectory to `annex-add` while a submodule underneath the specified path happens to be modified. addSmallOverridden already routes symbolic links through addFile rather than using the custom hash-object/update-index call. The latter is valid only for regular files, so extend this condition so that everything that isn't a regular file goes through addFile. Doing so avoids the above error because submodules come in as directories. --- diff --git a/Command/Add.hs b/Command/Add.hs index 56e6fb2361..72aae5f3c6 100644 --- a/Command/Add.hs +++ b/Command/Add.hs @@ -108,7 +108,7 @@ addSmallOverridden file = do showNote "adding content to git repository" let file' = fromRawFilePath file s <- liftIO $ getSymbolicLinkStatus file' - if isSymbolicLink s + if not (isRegularFile s) then addFile file else do -- Can't use addFile because the clean filter will