reinject: Error out when run on a file that is not annexed

rather than silently skipping it
This commit is contained in:
Joey Hess 2021-05-07 13:31:03 -04:00
parent 4bf7940d6b
commit 921753ac44
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 14 additions and 1 deletions

View file

@ -8,6 +8,8 @@ git-annex (8.20210429) UNRELEASED; urgency=medium
* Fix behavior of several commands, including reinject, addurl, and rmurl
when given an absolute path to an unlocked file, or a relative path
that leaves and re-enters the repository.
* reinject: Error out when run on a file that is not annexed, rather
than silently skipping it.
-- Joey Hess <id@joeyh.name> Mon, 03 May 2021 10:33:10 -0400

View file

@ -44,7 +44,9 @@ startSrcDest :: [FilePath] -> CommandStart
startSrcDest ps@(src:dest:[])
| src == dest = stop
| otherwise = notAnnexed src' $
ifAnnexed (toRawFilePath dest) go stop
ifAnnexed (toRawFilePath dest)
go
(giveup $ src ++ " is not an annexed file")
where
src' = toRawFilePath src
go key = starting "reinject" ai si $

View file

@ -39,3 +39,5 @@ configuration in the script above) or a relative path is used
[[!meta author=kyle]]
[[!tag projects/datalad]]
> [[fixed|done]] --[[Joey]]

View file

@ -0,0 +1,7 @@
[[!comment format=mdwn
username="joey"
subject="""comment 2"""
date="2021-05-07T17:28:43Z"
content="""
Fixed them all, and made reinject not skip over non-annexed files.
"""]]