diff options
| author | Meet Soni <meetsoni3017@gmail.com> | 2025-09-19 13:56:47 +0530 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-09-19 10:02:56 -0700 |
| commit | c44afd67d2bcfc2958e7cc79d7064ab5fcfa468a (patch) | |
| tree | cde601b3c4e772168e245d907f56248b0634b984 /t/t1463-refs-optimize.sh | |
| parent | ac0bad0af488aa25ffb2363f79b7e5728fd0cf97 (diff) | |
| download | git-c44afd67d2bcfc2958e7cc79d7064ab5fcfa468a.tar.gz | |
t: add test for git refs optimize subcommand
Add a test script, `t/t1463-refs-optimize.sh`, for the new `git refs
optimize` command.
This script acts as a simple driver, leveraging the shared test library
created in the preceding commit. It works by overriding the
`$pack_refs` variable to "refs optimize" and then sourcing the
shared library (`t/pack-refs-tests.sh`).
This approach ensures that `git refs optimize` is tested against the
entire comprehensive test suite of `git pack-refs`, verifying
that it acts as a compatible drop-in replacement.
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>
Diffstat (limited to 't/t1463-refs-optimize.sh')
| -rwxr-xr-x | t/t1463-refs-optimize.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t1463-refs-optimize.sh b/t/t1463-refs-optimize.sh new file mode 100755 index 0000000000..c11c905d79 --- /dev/null +++ b/t/t1463-refs-optimize.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +test_description='git refs optimize should not change the branch semantic + +This test runs git refs optimize 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 + +pack_refs='refs optimize' +. "$TEST_DIRECTORY"/pack-refs-tests.sh |
