diff mbox series

[v2] t1512: test ambiguous cat-file --batch and --batch-output

Message ID 20190130213349.h5xiujbbtw4o3i35@dcvr (mailing list archive)
State New, archived
Headers show
Series [v2] t1512: test ambiguous cat-file --batch and --batch-output | expand

Commit Message

Eric Wong Jan. 30, 2019, 9:33 p.m. UTC
SZEDER Gábor <szeder.dev@gmail.com> wrote:
> The 'git cat-file's error message and hints are translated, so they
> should be checked by 'test_i18ngrep' instead of plain old grep.

Thanks, here's v2 with test_i18ngrep

--------8<------
Subject: [PATCH] t1512: test ambiguous cat-file --batch and --batch-output

Test the new "ambiguous" result from cat-file --batch and
--batch-check.  This is in t1512 instead of t1006 since
we need a repo with ambiguous object_id names.

Signed-off-by: Eric Wong <e@80x24.org>
---
 t/t1512-rev-parse-disambiguation.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/t/t1512-rev-parse-disambiguation.sh b/t/t1512-rev-parse-disambiguation.sh
index e4d5b56014..c19fb500cb 100755
--- a/t/t1512-rev-parse-disambiguation.sh
+++ b/t/t1512-rev-parse-disambiguation.sh
@@ -388,4 +388,14 @@  test_expect_success C_LOCALE_OUTPUT 'ambiguous commits are printed by type first
 	done
 '
 
+test_expect_success 'cat-file --batch and --batch-check show ambiguous' '
+	echo "0000 ambiguous" >expect &&
+	echo 0000 | git cat-file --batch-check >actual 2>err &&
+	test_cmp expect actual &&
+	test_i18ngrep hint: err &&
+	echo 0000 | git cat-file --batch >actual 2>err &&
+	test_cmp expect actual &&
+	test_i18ngrep hint: err
+'
+
 test_done