@@ -210,16 +210,21 @@ test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '
test_expect_success 'rev-list W/ --missing=print and --missing=allow-any for trees' '
TREE=$(git -C r3 rev-parse HEAD:dir1) &&
- rm r3/.git/objects/$(echo $TREE | sed "s|^..|&/|") &&
+ # Create a spare repo because we will be deleting objects from this one.
+ git clone r3 r3.b &&
- git -C r3 rev-list --quiet --missing=print --objects HEAD >missing_objs 2>rev_list_err &&
+ rm r3.b/.git/objects/$(echo $TREE | sed "s|^..|&/|") &&
+
+ git -C r3.b rev-list --quiet --missing=print --objects HEAD \
+ >missing_objs 2>rev_list_err &&
echo "?$TREE" >expected &&
test_cmp expected missing_objs &&
# do not complain when a missing tree cannot be parsed
test_must_be_empty rev_list_err &&
- git -C r3 rev-list --missing=allow-any --objects HEAD >objs 2>rev_list_err &&
+ git -C r3.b rev-list --missing=allow-any --objects HEAD \
+ >objs 2>rev_list_err &&
! grep $TREE objs &&
test_must_be_empty rev_list_err
'
@@ -228,12 +233,13 @@ test_expect_success 'rev-list W/ --missing=print and --missing=allow-any for tre
test_expect_success 'verify tree:0 includes trees in "filtered" output' '
git -C r3 rev-list --quiet --objects --filter-print-omitted \
- --filter=tree:0 HEAD |
- awk -f print_1.awk |
+ --filter=tree:0 HEAD >revs &&
+
+ awk -f print_1.awk revs |
sed s/~// |
- xargs -n1 git -C r3 cat-file -t |
- sort -u >filtered_types &&
+ xargs -n1 git -C r3 cat-file -t >unsorted_filtered_types &&
+ sort -u unsorted_filtered_types >filtered_types &&
printf "blob\ntree\n" >expected &&
test_cmp expected filtered_types
'