]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t1512: test ambiguous cat-file --batch and --batch-output
authorEric Wong <e@80x24.org>
Wed, 30 Jan 2019 21:33:49 +0000 (21:33 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 31 Jan 2019 18:52:37 +0000 (10:52 -0800)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1512-rev-parse-disambiguation.sh

index e4d5b56014822ff760d3eab6d7c798f8d932ca45..c19fb500cb225273fce730c656fea00a3ada624d 100755 (executable)
@@ -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