From: Meet Soni <meetsoni3017@gmail.com>
To: git@vger.kernel.org
Cc: ps@pks.im, shejialuo@gmail.com, gitster@pobox.com,
Meet Soni <meetsoni3017@gmail.com>
Subject: [GSoC][PATCH v3 4/4] t: add test for git refs exists subcommand
Date: Tue, 26 Aug 2025 12:11:10 +0530 [thread overview]
Message-ID: <20250826064110.10540-5-meetsoni3017@gmail.com> (raw)
In-Reply-To: <20250826064110.10540-1-meetsoni3017@gmail.com>
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>
---
t/meson.build | 1 +
t/t1462-refs-exists.sh | 10 ++++++++++
2 files changed, 11 insertions(+)
create mode 100755 t/t1462-refs-exists.sh
diff --git a/t/meson.build b/t/meson.build
index 4d6bc3d38e..93e9773ec8 100644
--- a/t/meson.build
+++ b/t/meson.build
@@ -211,6 +211,7 @@ integration_tests = [
't1451-fsck-buffer.sh',
't1460-refs-migrate.sh',
't1461-refs-list.sh',
+ 't1462-refs-exists.sh',
't1500-rev-parse.sh',
't1501-work-tree.sh',
't1502-rev-parse-parseopt.sh',
diff --git a/t/t1462-refs-exists.sh b/t/t1462-refs-exists.sh
new file mode 100755
index 0000000000..349453c4ca
--- /dev/null
+++ b/t/t1462-refs-exists.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+test_description='refs exists'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
+. ./test-lib.sh
+
+git_show_ref_exists='git refs exists'
+. "$TEST_DIRECTORY"/show-ref-exists-tests.sh
--
2.34.1
next prev parent reply other threads:[~2025-08-26 6:41 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-21 8:52 [GSoC][PATCH 0/2] Add refs exists subcommand Meet Soni
2025-08-21 8:52 ` [GSoC][PATCH 1/2] builtin/refs: add 'exists' subcommand Meet Soni
2025-08-21 10:21 ` Patrick Steinhardt
2025-08-21 8:52 ` [GSoC][PATCH 2/2] t: add test for git refs exists subcommand Meet Soni
2025-08-21 10:21 ` Patrick Steinhardt
2025-08-22 4:59 ` Meet Soni
2025-08-21 10:21 ` [GSoC][PATCH 0/2] Add " Patrick Steinhardt
2025-08-21 16:01 ` Junio C Hamano
2025-08-22 4:27 ` Meet Soni
2025-08-23 6:00 ` [GSoC][PATCH v2 0/4] " Meet Soni
2025-08-23 6:00 ` [GSoC][PATCH v2 1/4] builtin/refs: add 'exists' subcommand Meet Soni
2025-08-23 6:00 ` [GSoC][PATCH v2 2/4] t1403: split 'show-ref --exists' tests into a separate file Meet Soni
2025-08-23 6:00 ` [GSoC][PATCH v2 3/4] t1422: refactor tests to be shareable Meet Soni
2025-08-24 16:58 ` Patrick Steinhardt
2025-08-23 6:00 ` [GSoC][PATCH v2 4/4] t: add test for git refs exists subcommand Meet Soni
2025-08-24 16:58 ` [GSoC][PATCH v2 0/4] Add " Patrick Steinhardt
2025-08-26 6:41 ` [GSoC][PATCH v3 " Meet Soni
2025-08-26 6:41 ` [GSoC][PATCH v3 1/4] builtin/refs: add 'exists' subcommand Meet Soni
2025-08-26 6:41 ` [GSoC][PATCH v3 2/4] t1403: split 'show-ref --exists' tests into a separate file Meet Soni
2025-08-26 6:41 ` [GSoC][PATCH v3 3/4] t1422: refactor tests to be shareable Meet Soni
2025-08-26 6:41 ` Meet Soni [this message]
2025-09-02 11:52 ` [GSoC][PATCH v3 0/4] Add refs exists subcommand Patrick Steinhardt
2025-09-02 16:57 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250826064110.10540-5-meetsoni3017@gmail.com \
--to=meetsoni3017@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=ps@pks.im \
--cc=shejialuo@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.