diff options
| author | Meet Soni <meetsoni3017@gmail.com> | 2025-08-26 12:11:10 +0530 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-09-02 09:58:36 -0700 |
| commit | ef94b3e5c609ea2bd87c7ed9e9fcf8750430e4ac (patch) | |
| tree | 1a5a4342e170c410793964a8fcad690a6386daeb /t/t1462-refs-exists.sh | |
| parent | t1422: refactor tests to be shareable (diff) | |
| download | git-ef94b3e5c609ea2bd87c7ed9e9fcf8750430e4ac.tar.gz git-ef94b3e5c609ea2bd87c7ed9e9fcf8750430e4ac.zip | |
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>
Diffstat (limited to '')
| -rwxr-xr-x | t/t1462-refs-exists.sh | 10 |
1 files changed, 10 insertions, 0 deletions
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 |
