public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jayesh Daga via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Justin Tobler <jltobler@gmail.com>,
	Ayush Chandekar <ayu.chandekar@gmail.com>,
	Siddharth Asthana <siddharthasthana31@gmail.com>,
	Jayesh Daga <jayeshdaga99@gmail.com>,
	jayesh0104 <jayeshdaga99@gmail.com>
Subject: [PATCH] t/t2107-update-index-basic: use test_path_is_missing
Date: Sun, 22 Mar 2026 16:40:00 +0000	[thread overview]
Message-ID: <pull.2250.git.git.1774197600379.gitgitgadget@gmail.com> (raw)

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

             reply	other threads:[~2026-03-22 16:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-22 16:40 Jayesh Daga via GitGitGadget [this message]
2026-03-22 21:55 ` [PATCH] t/t2107-update-index-basic: use test_path_is_missing 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=pull.2250.git.git.1774197600379.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=ayu.chandekar@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jayeshdaga99@gmail.com \
    --cc=jltobler@gmail.com \
    --cc=siddharthasthana31@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox