]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t: add test for git refs list subcommand
authorMeet Soni <meetsoni3017@gmail.com>
Tue, 5 Aug 2025 09:27:58 +0000 (14:57 +0530)
committerJunio C Hamano <gitster@pobox.com>
Tue, 5 Aug 2025 16:11:55 +0000 (09:11 -0700)
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>
t/meson.build
t/t1461-refs-list.sh [new file with mode: 0755]

index bbeba1a8d50e1bb2174e9548656a8f10f5c1fd9d..23a370295891cf8c1c36f34de8cbfc2c7a066b0a 100644 (file)
@@ -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 (executable)
index 0000000..36e3d81
--- /dev/null
@@ -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