Skip to content

Commit fed66d9

Browse files
inosmeetgitster
authored andcommitted
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 <[email protected]> Mentored-by: shejialuo <[email protected]> Mentored-by: Karthik Nayak <[email protected]> Signed-off-by: Meet Soni <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent aa91c5c commit fed66d9

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

t/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ integration_tests = [
208208
't1450-fsck.sh',
209209
't1451-fsck-buffer.sh',
210210
't1460-refs-migrate.sh',
211+
't1461-refs-list.sh',
211212
't1500-rev-parse.sh',
212213
't1501-work-tree.sh',
213214
't1502-rev-parse-parseopt.sh',

t/t1461-refs-list.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

0 commit comments

Comments
 (0)