reinject: Fix crash when reinjecting a file from outside the repository
Commit 4bf7940d6b
introduced this
problem, but was otherwise doing a good thing. Problem being
that fileRef "/foo" used to return ":./foo", which was actually wrong,
but as long as there was no foo in the local repository, catKey
could operate on it without crashing. After that fix though, fileRef
would return eg "../../foo", resulting in fileRef returning
":./../../foo", which will make git cat-file crash since that's
not a valid path in the repo.
Fix is simply to make fileRef detect paths outside the repo and return
Nothing. Then catKey can be skipped. This needed several bugfixes to
dirContains as well, in previous commits.
In Command.Smudge, this led to needing to check for Nothing. That case
should actually never happen, because the fileoutsiderepo check will
detect it earlier.
Sponsored-by: Brock Spratlen on Patreon
This commit is contained in:
parent
b2efbd1cd3
commit
9012fa0187
7 changed files with 48 additions and 22 deletions
|
@ -24,3 +24,5 @@ By means of bisection I have determined that commit 4bf7940d6b912fbf692b268f621e
|
|||
git-annex: fd:15: Data.ByteString.hGetLine: end of file
|
||||
|
||||
--spwhitton
|
||||
|
||||
> [[fixed|done]] --[[Joey]]
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
[[!comment format=mdwn
|
||||
username="joey"
|
||||
subject="""comment 1"""
|
||||
date="2021-10-01T16:42:36Z"
|
||||
content="""
|
||||
Also happens with a relative path to the file. And also
|
||||
`git annex reinject ../bar bar` fails the same way.
|
||||
|
||||
Fixed. In case you want to cherry-pick the fix, it's the commit adding
|
||||
this comment, as well as the 2 prior commits fixing bugs in dirContains.
|
||||
"""]]
|
Loading…
Add table
Add a link
Reference in a new issue