]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t1500-rev-parse.sh
rev-parse: rev-parse: add --is-shallow-repository
[thirdparty/git.git] / t / t1500-rev-parse.sh
index 03d3c7f6d65b46bf977adf76a6d68582206768c2..5c715fe2cf6c7afe2c39e6a7197cdd3d33329b8b 100755 (executable)
@@ -116,6 +116,21 @@ test_expect_success 'git-path inside sub-dir' '
        test_cmp expect actual
 '
 
+test_expect_success 'rev-parse --is-shallow-repository in shallow repo' '
+       test_commit test_commit &&
+       echo true >expect &&
+       git clone --depth 1 --no-local . shallow &&
+       test_when_finished "rm -rf shallow" &&
+       git -C shallow rev-parse --is-shallow-repository >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success 'rev-parse --is-shallow-repository in non-shallow repo' '
+       echo false >expect &&
+       git rev-parse --is-shallow-repository >actual &&
+       test_cmp expect actual
+'
+
 test_expect_success 'showing the superproject correctly' '
        git rev-parse --show-superproject-working-tree >out &&
        test_must_be_empty out &&