aboutsummaryrefslogtreecommitdiff
path: root/t/t8010-cat-file-filters.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2016-09-09 12:10:54 +0200
committerJunio C Hamano <gitster@pobox.com>2016-09-11 14:48:15 -0700
commit321459439e19517c412cab1cfbb64a2749f272c9 (patch)
treec554f8d87a9ba17218b7b96f4af7e18fd31eadfa /t/t8010-cat-file-filters.sh
parent7bcf341453572a227036afec76bdab451b798870 (diff)
downloadgit-321459439e19517c412cab1cfbb64a2749f272c9.tar.gz
git-321459439e19517c412cab1cfbb64a2749f272c9.tar.xz
cat-file: support --textconv/--filters in batch mode
With this patch, --batch can be combined with --textconv or --filters. For this to work, the input needs to have the form <object name><single white space><path> so that the filters can be chosen appropriately. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t8010-cat-file-filters.sh')
-rwxr-xr-xt/t8010-cat-file-filters.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t8010-cat-file-filters.sh b/t/t8010-cat-file-filters.sh
index 3d5ad7df9..d8242e467 100755
--- a/t/t8010-cat-file-filters.sh
+++ b/t/t8010-cat-file-filters.sh
@@ -51,4 +51,14 @@ test_expect_success '--path=<path> complains without --textconv/--filters' '
grep "path.*needs.*filters" err
'
+test_expect_success 'cat-file --textconv --batch works' '
+ sha1=$(git rev-parse -q --verify HEAD:world.txt) &&
+ test_config diff.txt.textconv "tr A-Za-z N-ZA-Mn-za-m <" &&
+ printf "%s hello.txt\n%s hello\n" $sha1 $sha1 |
+ git cat-file --textconv --batch >actual &&
+ printf "%s blob 6\nuryyb\r\n\n%s blob 6\nhello\n\n" \
+ $sha1 $sha1 >expect &&
+ test_cmp expect actual
+'
+
test_done