]> git.ipfire.org Git - thirdparty/git.git/commit
t6300: refactor tests to be shareable
authorMeet Soni <meetsoni3017@gmail.com>
Tue, 5 Aug 2025 09:27:57 +0000 (14:57 +0530)
committerJunio C Hamano <gitster@pobox.com>
Tue, 5 Aug 2025 16:11:55 +0000 (09:11 -0700)
commitaa91c5c57013bdeca7b58ee5044bf667a4757978
tree9f80d756fa45e6da25fb0a6fef50b8ce79a3a156
parenteecccfe98bb023a79f3c2b8bc415b6d656d0d381
t6300: refactor tests to be shareable

In preparation for adding tests for the new `git refs list` command,
refactor the existing t6300 test suite to make its logic shareable.

Move the core test logic from `t6300-for-each-ref.sh` into a new
`for-each-ref-tests.sh` file. Inside this new script, replace hardcoded
calls to "git for-each-ref" with the `$git_for_each_ref` variable.

The original `t6300-for-each-ref.sh` script now becomes a simple
"driver". It is responsible for setting the default value of the
variable and then sourcing the test library.

This new structure follows the established pattern used for sharing
tests between `git-blame` and `git-annotate` and prepares the test suite
for the `refs list` tests to be added in a subsequent commit.

Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: shejialuo <shejialuo@gmail.com>
Mentored-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Meet Soni <meetsoni3017@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/for-each-ref-tests.sh [new file with mode: 0644]
t/t6300-for-each-ref.sh