mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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>
21 lines
476 B
Bash
Executable File
21 lines
476 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Copyright (c) 2005 Amos Waterland
|
|
# Copyright (c) 2006 Christian Couder
|
|
#
|
|
|
|
test_description='git pack-refs should not change the branch semantic
|
|
|
|
This test runs git pack-refs and git show-ref and checks that the branch
|
|
semantic is still the same.
|
|
'
|
|
|
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
|
GIT_TEST_DEFAULT_REF_FORMAT=files
|
|
export GIT_TEST_DEFAULT_REF_FORMAT
|
|
|
|
. ./test-lib.sh
|
|
|
|
. "$TEST_DIRECTORY"/pack-refs-tests.sh
|