Merge branch 'jk/ident-loosen-getpwuid' into maint
[gitweb.git] / t / t1006-cat-file.sh
index 93a4794930bfebc99504a245392f32a3c92b3dde..4f38078ff36f5a877defc360feaf6fdba804ccc1 100755 (executable)
@@ -547,4 +547,30 @@ test_expect_success 'git cat-file --batch --follow-symlink returns correct sha a
        test_cmp expect actual
 '
 
+test_expect_success 'cat-file --batch-all-objects shows all objects' '
+       # make new repos so we know the full set of objects; we will
+       # also make sure that there are some packed and some loose
+       # objects, some referenced and some not, and that there are
+       # some available only via alternates.
+       git init all-one &&
+       (
+               cd all-one &&
+               echo content >file &&
+               git add file &&
+               git commit -qm base &&
+               git rev-parse HEAD HEAD^{tree} HEAD:file &&
+               git repack -ad &&
+               echo not-cloned | git hash-object -w --stdin
+       ) >expect.unsorted &&
+       git clone -s all-one all-two &&
+       (
+               cd all-two &&
+               echo local-unref | git hash-object -w --stdin
+       ) >>expect.unsorted &&
+       sort <expect.unsorted >expect &&
+       git -C all-two cat-file --batch-all-objects \
+                               --batch-check="%(objectname)" >actual &&
+       test_cmp expect actual
+'
+
 test_done