t: add test for git refs exists subcommand

Add a test script, `t/t1462-refs-exists.sh`, for the `git refs exists` command. This script acts as a simple driver, leveraging the shared test library created in the preceding commit. It works by overriding the `$git_show_ref_exists` variable to "git refs exists" and then sourcing the shared library (`t/show-ref-exists-tests.sh`). This approach ensures that `git refs exists` is tested against the entire comprehensive test suite of `git show-ref --exists`, verifying that it acts as a compatible drop-in replacement. Mentored-by: Patrick Steinhardt <ps@pks.im> Mentored-by: shejialuo <shejialuo@gmail.com> Signed-off-by: Meet Soni <meetsoni3017@gmail.com> Acked-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Meet Soni committed Aug 26, 2025 at 12:11 UTC ef94b3e5c609ea2bd87c7ed9e9fcf8750430e4ac
2 files changed +11
t/meson.build
+1
@@ -211,6 +211,7 @@ integration_tests = [
211 't1451-fsck-buffer.sh',
212 't1460-refs-migrate.sh',
213 't1461-refs-list.sh',
214 + 't1462-refs-exists.sh',
215 't1500-rev-parse.sh',
216 't1501-work-tree.sh',
217 't1502-rev-parse-parseopt.sh',
t/t1462-refs-exists.sh new
+10
@@ -0,0 +1,10 @@
1 +#!/bin/sh
2 +
3 +test_description='refs exists'
4 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
5 +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
6 +
7 +. ./test-lib.sh
8 +
9 +git_show_ref_exists='git refs exists'
10 +. "$TEST_DIRECTORY"/show-ref-exists-tests.sh