Skip to content

Commit 61e1c56

Browse files
pks-tgitster
authored andcommitted
t1419: mark test suite as files-backend specific
With 59c35fa (refs/packed-backend.c: implement jump lists to avoid excluded pattern(s), 2023-07-10) we have implemented logic to handle excluded refs more efficiently in the "packed" ref backend. This logic allows us to skip emitting refs completely which we know to not be of any interest to the caller, which can avoid quite some allocations and object lookups. This was wired up via a new `exclude_patterns` parameter passed to the backend's ref iterator. The backend only needs to handle them on a best effort basis though, and in fact we only handle it for the "packed-refs" file, but not for loose references. Consequently, all callers must still filter emitted refs with those exclude patterns. The result is that handling exclude patterns is completely optional in the ref backend, and any future backends may or may not implement it. Let's thus mark the test for t1419 to depend on the REFFILES prereq. An alternative would be to introduce a new prereq that tells us whether the backend under test supports exclude patterns or not. But this does feel a bit overblown: - It would either map to the REFFILES prereq, in which case it feels overengineered because the prereq is only ever relevant to t1419. - Otherwise, it could auto-detect whether the backend supports exclude patterns. But this could lead to silent failures in case the support for this feature breaks at any point in time. It should thus be good enough to just use the REFFILES prereq for now. If future backends ever grow support for exclude patterns we can easily add their respective prereq as another condition for this test suite to execute. Signed-off-by: Patrick Steinhardt <[email protected]> Reviewed-by: Christian Couder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent afb9932 commit 61e1c56

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

t/t1419-exclude-refs.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
88
TEST_PASSES_SANITIZE_LEAK=true
99
. ./test-lib.sh
1010

11+
if test_have_prereq !REFFILES
12+
then
13+
skip_all='skipping `git for-each-ref --exclude` tests; need files backend'
14+
test_done
15+
fi
16+
1117
for_each_ref__exclude () {
1218
GIT_TRACE2_PERF=1 test-tool ref-store main \
1319
for-each-ref--exclude "$@" >actual.raw

0 commit comments

Comments
 (0)