From: Meet Soni Date: Tue, 5 Aug 2025 09:27:58 +0000 (+0530) Subject: t: add test for git refs list subcommand X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fed66d91c0fce8a1911b24ad79ed9f10d411874e;p=thirdparty%2Fgit.git t: add test for git refs list subcommand Add a test script, `t/t1461-refs-list.sh`, for the new `git refs list` command. This script acts as a simple driver, leveraging the shared test library created in the preceding commit. It works by overriding the `$git_for_each_ref` variable to "git refs list" and then sourcing the shared library (`t/for-each-ref-tests.sh`). This approach ensures that `git refs list` is tested against the entire comprehensive test suite of `git for-each-ref`, verifying that it acts as a compatible drop-in replacement. Mentored-by: Patrick Steinhardt Mentored-by: shejialuo Mentored-by: Karthik Nayak Signed-off-by: Meet Soni Signed-off-by: Junio C Hamano --- diff --git a/t/meson.build b/t/meson.build index bbeba1a8d5..23a3702958 100644 --- a/t/meson.build +++ b/t/meson.build @@ -208,6 +208,7 @@ integration_tests = [ 't1450-fsck.sh', 't1451-fsck-buffer.sh', 't1460-refs-migrate.sh', + 't1461-refs-list.sh', 't1500-rev-parse.sh', 't1501-work-tree.sh', 't1502-rev-parse-parseopt.sh', diff --git a/t/t1461-refs-list.sh b/t/t1461-refs-list.sh new file mode 100755 index 0000000000..36e3d81e59 --- /dev/null +++ b/t/t1461-refs-list.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +test_description='git refs list tests' + +. ./test-lib.sh + +git_for_each_ref='git refs list' +. "$TEST_DIRECTORY"/for-each-ref-tests.sh