diff options
Diffstat (limited to 't')
-rwxr-xr-x | t/t5322-pack-objects-sparse.sh | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/t/t5322-pack-objects-sparse.sh b/t/t5322-pack-objects-sparse.sh index 30aef6498a..9f2a6e5d31 100755 --- a/t/t5322-pack-objects-sparse.sh +++ b/t/t5322-pack-objects-sparse.sh @@ -79,6 +79,9 @@ test_expect_success 'sparse pack-objects' ' test_cmp required_objects.txt sparse_required_objects.txt ' +# Demonstrate that the algorithms differ when we copy a tree wholesale +# from one folder to another. + test_expect_success 'duplicate a folder from f1 into f3' ' mkdir f3/f4 && cp -r f1/f1/* f3/f4 && @@ -95,7 +98,7 @@ test_expect_success 'duplicate a folder from f1 into f3' ' ' test_expect_success 'non-sparse pack-objects' ' - git pack-objects --stdout --revs <packinput.txt >nonsparse.pack && + git pack-objects --stdout --revs --no-sparse <packinput.txt >nonsparse.pack && git index-pack -o nonsparse.idx nonsparse.pack && git show-index <nonsparse.idx | awk "{print \$2}" >nonsparse_objects.txt && comm -1 -2 required_objects.txt nonsparse_objects.txt >nonsparse_required_objects.txt && @@ -103,11 +106,16 @@ test_expect_success 'non-sparse pack-objects' ' ' test_expect_success 'sparse pack-objects' ' + git rev-parse \ + topic1 \ + topic1^{tree} \ + topic1:f3 \ + topic1:f3/f4 \ + topic1:f3/f4/data.txt | sort >expect_sparse_objects.txt && git pack-objects --stdout --revs --sparse <packinput.txt >sparse.pack && git index-pack -o sparse.idx sparse.pack && git show-index <sparse.idx | awk "{print \$2}" >sparse_objects.txt && - comm -1 -2 required_objects.txt sparse_objects.txt >sparse_required_objects.txt && - test_cmp required_objects.txt sparse_required_objects.txt + test_cmp expect_sparse_objects.txt sparse_objects.txt ' test_done |