add warning on add of annex link

Warn when adding a annex symlink or pointer file that uses a key that is
not known to the repository, to prevent confusion if the user has copied it
from some other repository.

This commit was sponsored by Jake Vosloo on Patreon.
This commit is contained in:
Joey Hess 2020-11-10 12:10:51 -04:00
parent 9e8eae20e2
commit 92b7b1964d
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 36 additions and 14 deletions

View file

@ -98,8 +98,9 @@ clean file = do
where
go b = case parseLinkTargetOrPointerLazy b of
Just k -> do
getMoveRaceRecovery k file
liftIO $ L.hPut stdout b
addingExistingLink file k $ do
getMoveRaceRecovery k file
liftIO $ L.hPut stdout b
Nothing -> do
let fileref = Git.Ref.fileRef file
indexmeta <- catObjectMetaData fileref