]> git.ipfire.org Git - thirdparty/git.git/commit
t0601: refactor tests to be shareable
authorMeet Soni <meetsoni3017@gmail.com>
Fri, 19 Sep 2025 08:26:46 +0000 (13:56 +0530)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Sep 2025 17:02:56 +0000 (10:02 -0700)
commitac0bad0af488aa25ffb2363f79b7e5728fd0cf97
tree8f358dec2948bcbad3897b6adaed1797fc5daa1a
parentecc70a48a5ea5e568b1cbdd111f7ddba62dbe4d6
t0601: refactor tests to be shareable

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

Move the core test logic from `t0601-reffiles-pack-refs.sh` into a new
`pack-refs-tests.sh` file. Inside this new script, replace hardcoded
calls to "pack-refs" with the `$pack_refs` variable.

The original `t0601-reffiles-pack-refs.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-for-each-ref` and `git-refs list` and prepares the
test suite for the `refs optimize` tests to be added in a subsequent
commit.

Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Meet Soni <meetsoni3017@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/pack-refs-tests.sh [new file with mode: 0644]
t/t0601-reffiles-pack-refs.sh