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.
This commit is contained in:
Kyle Meyer 2020-03-23 15:45:15 -04:00 committed by Joey Hess
parent b426ff6825
commit 339aebc6ad
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -107,7 +107,7 @@ addSmallOverridden :: RawFilePath -> Annex Bool
addSmallOverridden file = do addSmallOverridden file = do
showNote "adding content to git repository" showNote "adding content to git repository"
let file' = fromRawFilePath file let file' = fromRawFilePath file
s <- liftIO $ getFileStatus file' s <- liftIO $ getSymbolicLinkStatus file'
if isSymbolicLink s if isSymbolicLink s
then addFile file then addFile file
else do else do