aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMeet Soni <meetsoni3017@gmail.com>2025-08-05 14:57:58 +0530
committerJunio C Hamano <gitster@pobox.com>2025-08-05 09:11:55 -0700
commitfed66d91c0fce8a1911b24ad79ed9f10d411874e (patch)
tree937dd150664ce191a7a2a031a950dd986c092383
parentaa91c5c57013bdeca7b58ee5044bf667a4757978 (diff)
downloadgit-fed66d91c0fce8a1911b24ad79ed9f10d411874e.tar.gz
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>
-rw-r--r--t/meson.build1
-rwxr-xr-xt/t1461-refs-list.sh8
2 files changed, 9 insertions, 0 deletions
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