diff options
author | Matthew DeVore <matvore@google.com> | 2019-01-09 05:59:14 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-01-16 02:39:34 +0300 |
commit | 8272f26034c9dbaf5cd216a137b8e91241cbc24e (patch) | |
tree | c18266c09529e4248b10a2587da1b83cbccc7207 /t/t6112-rev-list-filters-objects.sh | |
parent | c813a7c35f44f4bf435c6ecb21bf4b9ec8f227de (diff) |
tree:<depth>: skip some trees even when collecting omits
If a tree has already been recorded as omitted, we don't need to
traverse it again just to collect its omits. Stop traversing trees a
second time when collecting omits.
Signed-off-by: Matthew DeVore <matvore@google.com>
Reviewed-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6112-rev-list-filters-objects.sh')
-rwxr-xr-x | t/t6112-rev-list-filters-objects.sh | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh index 706845f1d9..eb9e4119e2 100755 --- a/t/t6112-rev-list-filters-objects.sh +++ b/t/t6112-rev-list-filters-objects.sh @@ -283,7 +283,7 @@ test_expect_success 'verify tree:0 includes trees in "filtered" output' ' # Make sure tree:0 does not iterate through any trees. -test_expect_success 'filter a GIANT tree through tree:0' ' +test_expect_success 'verify skipping tree iteration when not collecting omits' ' GIT_TRACE=1 git -C r3 rev-list \ --objects --filter=tree:0 HEAD 2>filter_trace && grep "Skipping contents of tree [.][.][.]" filter_trace >actual && @@ -377,6 +377,15 @@ test_expect_success 'test tree:# filter provisional omit for blob and tree' ' expect_has_with_different_name r4 filt/subdir ' +test_expect_success 'verify skipping tree iteration when collecting omits' ' + GIT_TRACE=1 git -C r4 rev-list --filter-print-omitted \ + --objects --filter=tree:0 HEAD 2>filter_trace && + grep "^Skipping contents of tree " filter_trace >actual && + + echo "Skipping contents of tree subdir/..." >expect && + test_cmp expect actual +' + # Test tree:<depth> where a tree is iterated to twice - once where a subentry is # too deep to be included, and again where the blob inside it is shallow enough # to be included. This makes sure we don't use LOFR_MARK_SEEN incorrectly (we |