summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorbrian m. carlson <bk2204@github.com>2020-03-16 18:05:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-03-16 18:37:02 (GMT)
commitc397aac02f9f97976f675115aa5df6ca01e26d59 (patch)
treec643560e7d3acf29889cc23498029a8bc956cc5a /t
parentab90ecae992e44e3e8303f143ad858608acabcf5 (diff)
downloadgit-c397aac02f9f97976f675115aa5df6ca01e26d59.zip
git-c397aac02f9f97976f675115aa5df6ca01e26d59.tar.gz
git-c397aac02f9f97976f675115aa5df6ca01e26d59.tar.bz2
convert: provide additional metadata to filters
Now that we have the codebase wired up to pass any additional metadata to filters, let's collect the additional metadata that we'd like to pass. The two main places we pass this metadata are checkouts and archives. In these two situations, reading HEAD isn't a valid option, since HEAD isn't updated for checkouts until after the working tree is written and archives can accept an arbitrary tree. In other situations, HEAD will usually reflect the refname of the branch in current use. We pass a smaller amount of data in other cases, such as git cat-file, where we can really only logically know about the blob. This commit updates only the parts of the checkout code where we don't use unpack_trees. That function and callers of it will be handled in a future commit. In the archive code, we leak a small amount of memory, since nothing we pass in the archiver argument structure is freed. Signed-off-by: brian m. carlson <bk2204@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rw-r--r--t/t0021/rot13-filter.pl6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t0021/rot13-filter.pl b/t/t0021/rot13-filter.pl
index 4701072..c43cf43 100644
--- a/t/t0021/rot13-filter.pl
+++ b/t/t0021/rot13-filter.pl
@@ -135,7 +135,13 @@ while (1) {
if ( exists $DELAY{$pathname} and $DELAY{$pathname}{"requested"} == 0 ) {
$DELAY{$pathname}{"requested"} = 1;
}
+ } elsif ($buffer =~ /^(ref|treeish|blob)=/) {
+ # Do nothing.
} else {
+ # In general, filters need to be graceful about
+ # new metadata, since it's documented that we
+ # can pass any key-value pairs, but for tests,
+ # let's be a little stricter.
die "Unknown message '$buffer'";
}