summaryrefslogtreecommitdiff
path: root/t/t5317-pack-objects-filter-objects.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t5317-pack-objects-filter-objects.sh')
-rwxr-xr-xt/t5317-pack-objects-filter-objects.sh13
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