l10n: de.po: various fixes in German translation
[gitweb.git] / t / t8010-cat-file-filters.sh
index e46663473200635749429001a407260aeb5f1b09..d8242e467eaa4f0a46cfa0a4ad431a447e58dd6c 100755 (executable)
@@ -31,4 +31,34 @@ test_expect_success 'cat-file --filters converts to worktree version' '
        has_cr actual
 '
 
+test_expect_success 'cat-file --filters --path=<path> works' '
+       sha1=$(git rev-parse -q --verify HEAD:world.txt) &&
+       git cat-file --filters --path=world.txt $sha1 >actual &&
+       has_cr actual
+'
+
+test_expect_success 'cat-file --textconv --path=<path> works' '
+       sha1=$(git rev-parse -q --verify HEAD:world.txt) &&
+       test_config diff.txt.textconv "tr A-Za-z N-ZA-Mn-za-m <" &&
+       git cat-file --textconv --path=hello.txt $sha1 >rot13 &&
+       test uryyb = "$(cat rot13 | remove_cr)"
+'
+
+test_expect_success '--path=<path> complains without --textconv/--filters' '
+       sha1=$(git rev-parse -q --verify HEAD:world.txt) &&
+       test_must_fail git cat-file --path=hello.txt blob $sha1 >actual 2>err &&
+       test ! -s actual &&
+       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