smudge: Warn when encountering a pointer file that has other content appended to it

It will then proceed to add the file the same as if it were any other
file containing possibly annexable content. Usually the file is one that
was annexed before, so the new, probably corrupt content will also be added
to the annex. If the file was not annexed before, the content will be added
to git.

It's not possible for the smudge filter to throw an error here, because
git then just adds the file to git anyway.

Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
Joey Hess 2022-02-23 15:17:08 -04:00
parent 67245ae00f
commit 64ccb4734e
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 55 additions and 23 deletions

View file

@ -83,7 +83,7 @@ clean file = do
-- hash the content provided by git, but Backend does not currently
-- have an interface to do so.
Command.Smudge.clean' (toRawFilePath file)
(parseLinkTargetOrPointer b)
(parseLinkTargetOrPointer' b)
passthrough
discardreststdin
emitpointer