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 <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>
Meet Soni committed
Aug 5, 2025 at 14:57 UTC
fed66d91c0fce8a1911b24ad79ed9f10d411874e
2 files changed
+9
t/meson.build
+1
@@ -208,6 +208,7 @@ integration_tests = [
208
't1450-fsck.sh',
209
't1451-fsck-buffer.sh',
210
't1460-refs-migrate.sh',
211
+ 't1461-refs-list.sh',
212
't1500-rev-parse.sh',
213
't1501-work-tree.sh',
214
't1502-rev-parse-parseopt.sh',
t/t1461-refs-list.sh
new
+8
@@ -0,0 +1,8 @@
1
+#!/bin/sh
2
+
3
+test_description='git refs list tests'
4
+
5
+. ./test-lib.sh
6
+
7
+git_for_each_ref='git refs list'
8
+. "$TEST_DIRECTORY"/for-each-ref-tests.sh