]> git.99rst.org Git - git.git/commit
t7900: simplify how we check for maintenance tasks
authorPatrick Steinhardt <redacted>
Mon, 13 Jul 2026 05:52:04 +0000 (07:52 +0200)
committerJunio C Hamano <redacted>
Mon, 13 Jul 2026 15:13:16 +0000 (08:13 -0700)
commit368565e55d5cff377efaee5cf86f092709480314
tree1c9d21f22f40071776b821ece21800230ef6c050
parentf85a7e662054a7b0d9070e432508831afa214b47
t7900: simplify how we check for maintenance tasks

We have several tests in t7900 that verify whether specific maintenance
tasks did or did not run. This is done rather ad-hoc by checking for
spawned Git commands, which is awfully fragile:

  - We have to adjust tests whenever arguments to the spawned Git
    commands change.

  - We don't have a way to verify that negative matches are still
    working as expected.

  - We rely on maintenance tasks spawning a Git command in the first
    place.

We can do much better though, as we already have trace2 regions for each
of the maintenance tasks. Introduce a helper function that extracts all
such regions so that we can get a direct list of all maintenance tasks
that a certain command ran.

Adapt tests that care about whether or not a specific task ran to use
this new helper. Note that many tests still use `test_subcommand`
though, as they really care about the exact command that was executed.

Signed-off-by: Patrick Steinhardt <redacted>
Signed-off-by: Junio C Hamano <redacted>
t/t7900-maintenance.sh
git clone https://git.99rst.org/PROJECT