* [PATCH] t/t2107-update-index-basic: use test_path_is_missing
@ 2026-03-22 16:40 Jayesh Daga via GitGitGadget
2026-03-22 21:55 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Jayesh Daga via GitGitGadget @ 2026-03-22 16:40 UTC (permalink / raw)
To: git
Cc: Justin Tobler, Ayush Chandekar, Siddharth Asthana, Jayesh Daga,
jayesh0104
From: jayesh0104 <jayeshdaga99@gmail.com>
Replace a raw '! test -f' check with test_path_is_missing to
use the standard test helper and improve consistency with
other tests.
Signed-off-by: Jayesh Daga <jayeshdaga99@gmail.com>
---
[GSoC]: t2107-refs-tests: drop '-f' from test_path_is_missing
High-level (Intent & Context)
=============================
The test script t/pack-refs-tests.sh has two issues that prevent it from
running correctly.
It uses: ! test -f .git/index.lock
This is inconsistent with the Git test framework, where helper functions
such as test_path_is_missing should be used instead of raw test checks.
Low-level (Implementation & Justification)
==========================================
Without sourcing test-lib.sh, the test framework is not initialized,
leading to errors such as: test_expect_success: not found
Replaced raw file check with the appropriate helper:
- ! test -f .git/index.lock
+ test_path_is_missing .git/index.lock
Summary
=======
Replace test_path_is_missing .git/index.lock
cc :Karthik Nayak karthik.188@gmail.com
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2250%2Fjayesh0104%2Ft2107-missing-helper-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2250/jayesh0104/t2107-missing-helper-v1
Pull-Request: https://github.com/git/git/pull/2250
t/t2107-update-index-basic.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t2107-update-index-basic.sh b/t/t2107-update-index-basic.sh
index cc72ead79f..3bffe5da8a 100755
--- a/t/t2107-update-index-basic.sh
+++ b/t/t2107-update-index-basic.sh
@@ -86,7 +86,7 @@ test_expect_success '.lock files cleaned up' '
# the_index.cache_changed is zero, rollback_lock_file fails
git update-index --refresh --verbose >out &&
test_must_be_empty out &&
- ! test -f .git/index.lock
+ test_path_is_missing .git/index.lock
)
'
base-commit: 6e8d538aab8fe4dd07ba9fb87b5c7edcfa5706ad
--
gitgitgadget
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] t/t2107-update-index-basic: use test_path_is_missing
2026-03-22 16:40 [PATCH] t/t2107-update-index-basic: use test_path_is_missing Jayesh Daga via GitGitGadget
@ 2026-03-22 21:55 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2026-03-22 21:55 UTC (permalink / raw)
To: Jayesh Daga via GitGitGadget
Cc: git, Justin Tobler, Ayush Chandekar, Siddharth Asthana,
Jayesh Daga
"Jayesh Daga via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: jayesh0104 <jayeshdaga99@gmail.com>
The author identifier (name and email) used here to identify the
author must match the identifier used to sign-off. You'd probably
need to "git commit --amend --reset-author" this commit with updatec
user.name set to "Jayesh Daga", not "jayesh0104" or something.
>
> Replace a raw '! test -f' check with test_path_is_missing to
> use the standard test helper and improve consistency with
> other tests.
>
> Signed-off-by: Jayesh Daga <jayeshdaga99@gmail.com>
> ---
> t/t2107-update-index-basic.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t2107-update-index-basic.sh b/t/t2107-update-index-basic.sh
> index cc72ead79f..3bffe5da8a 100755
> --- a/t/t2107-update-index-basic.sh
> +++ b/t/t2107-update-index-basic.sh
> @@ -86,7 +86,7 @@ test_expect_success '.lock files cleaned up' '
> # the_index.cache_changed is zero, rollback_lock_file fails
> git update-index --refresh --verbose >out &&
> test_must_be_empty out &&
> - ! test -f .git/index.lock
> + test_path_is_missing .git/index.lock
> )
> '
>
>
> base-commit: 6e8d538aab8fe4dd07ba9fb87b5c7edcfa5706ad
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-22 21:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-22 16:40 [PATCH] t/t2107-update-index-basic: use test_path_is_missing Jayesh Daga via GitGitGadget
2026-03-22 21:55 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox