]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t1500-rev-parse.sh
Merge branch 'bc/hash-independent-tests-part-6'
[thirdparty/git.git] / t / t1500-rev-parse.sh
index 01abee533dedfd1e2d8bd347d06fc5c0c8b7833a..0177fd815c03d9f3dafeb99e3e915bd89ba714c2 100755 (executable)
@@ -59,6 +59,7 @@ test_rev_parse () {
 ROOT=$(pwd)
 
 test_expect_success 'setup' '
+       test_oid_init &&
        mkdir -p sub/dir work &&
        cp -R .git repo.git
 '
@@ -131,6 +132,20 @@ test_expect_success 'rev-parse --is-shallow-repository in non-shallow repo' '
        test_cmp expect actual
 '
 
+test_expect_success 'rev-parse --show-object-format in repo' '
+       echo "$(test_oid algo)" >expect &&
+       git rev-parse --show-object-format >actual &&
+       test_cmp expect actual &&
+       git rev-parse --show-object-format=storage >actual &&
+       test_cmp expect actual &&
+       git rev-parse --show-object-format=input >actual &&
+       test_cmp expect actual &&
+       git rev-parse --show-object-format=output >actual &&
+       test_cmp expect actual &&
+       test_must_fail git rev-parse --show-object-format=squeamish-ossifrage 2>err &&
+       grep "unknown mode for --show-object-format: squeamish-ossifrage" err
+'
+
 test_expect_success 'showing the superproject correctly' '
        git rev-parse --show-superproject-working-tree >out &&
        test_must_be_empty out &&