diff options
author | Matthew DeVore <matvore@google.com> | 2018-10-06 00:31:23 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-10-07 02:55:00 +0300 |
commit | 7c0fe330d5f3d2fc7aac57a19c7580ea2543c799 (patch) | |
tree | 715ad64110c66efc978120aaab51c5a875dc4911 /t/t5317-pack-objects-filter-objects.sh | |
parent | f1d02daacfe657fd175634174b4928a645d537f4 (diff) |
rev-list: handle missing tree objects properly
Previously, we assumed only blob objects could be missing. This patch
makes rev-list handle missing trees like missing blobs. The --missing=*
and --exclude-promisor-objects flags now work for trees as they already
do for blobs. This is demonstrated in t6112.
Signed-off-by: Matthew DeVore <matvore@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5317-pack-objects-filter-objects.sh')
-rwxr-xr-x | t/t5317-pack-objects-filter-objects.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh index 6710c8bc8c..9839b48c1c 100755 --- a/t/t5317-pack-objects-filter-objects.sh +++ b/t/t5317-pack-objects-filter-objects.sh @@ -59,6 +59,19 @@ test_expect_success 'verify normal and blob:none packfiles have same commits/tre test_cmp observed expected ' +test_expect_success 'get an error for missing tree object' ' + git init r5 && + echo foo >r5/foo && + git -C r5 add foo && + git -C r5 commit -m "foo" && + del=$(git -C r5 rev-parse HEAD^{tree} | sed "s|..|&/|") && + rm r5/.git/objects/$del && + test_must_fail git -C r5 pack-objects --rev --stdout 2>bad_tree <<-EOF && + HEAD + EOF + grep -q "bad tree object" bad_tree +' + # Test blob:limit=<n>[kmg] filter. # We boundary test around the size parameter. The filter is strictly less than # the value, so size 500 and 1000 should have the same results, but 1001 should |