make catObjectStream support newline and carriage return in filenames

Turns out the %(rest) trick was not needed. Instead, just maintain a
list of files we've asked for, and each cat-file response is for the
next file in the list.

This actually benchmarks 25% faster than before! Very surprising, but it
must be due to needing to shove less data through the pipe, and parse
less.
This commit is contained in:
Joey Hess 2020-07-08 12:34:56 -04:00
parent 2cf6717aec
commit de3d7d044d
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 34 additions and 37 deletions

View file

@ -16,16 +16,12 @@ be as good as --all's was, but it could still be significant.
> to get file blob, through cat-file to get key, through cat-file to
> precache logs.
catObjectStream not supporting newline or carriage return needs to be dealt
with somehow first, because worktree filenames can contain either.
One odd edge case is, could there be a worktree file that refers to a key
with no location log? In that case, catObjectStream would skip it. This
doesn't usually happen. One case where it does happen is if the git-annex
branch is not pulled, but master is.
Perhaps both the newline and the missing location log could be dealt with
together, by making catObjectStream not skip them, but return an item
Perhaps make catObjectStream not skip them, but return an item
with no log file content. It's important things not be reordered when doing
that -- could a dummy item somehow be passed through cat-file to represent
these problem cases?