git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Rodrigo Carvalho <rodrigorsdc@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] t1001: replace 'test -f' with 'test_path_is_file'
Date: Mon, 12 May 2025 10:09:11 -0700	[thread overview]
Message-ID: <xmqqldr1u56w.fsf@gitster.g> (raw)
In-Reply-To: <20250510230909.65519-1-rodrigorsdc@gmail.com> (Rodrigo Carvalho's message of "Sat, 10 May 2025 20:09:09 -0300")

Rodrigo Carvalho <rodrigorsdc@gmail.com> writes:

> 'test_path_is_file' is a modern path checking method in Git's development.
>  Replace the basic shell command 'test -f' with this approach.
>
> Signed-off-by: Rodrigo Carvalho <rodrigorsdc@gmail.com>
> ---
>  t/t1001-read-tree-m-2way.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t1001-read-tree-m-2way.sh b/t/t1001-read-tree-m-2way.sh
> index 4a88bb9ef0..2e8d9384e1 100755
> --- a/t/t1001-read-tree-m-2way.sh
> +++ b/t/t1001-read-tree-m-2way.sh
> @@ -362,7 +362,7 @@ test_expect_success 'a/b (untracked) vs a case setup.' '
>  test_expect_success 'a/b (untracked) vs a, plus c/d case test.' '
>  	read_tree_u_must_fail -u -m "$treeH" "$treeM" &&
>  	git ls-files --stage &&
> -	test -f a/b
> +	test_path_is_file a/b
>  '

Obviously correct conversion.

This is an ancient part of the system, started before we even had a
"git checkout" rewritten as a single command, so it is not
surprising if it had quite a lot of antiquities and debugging
statement without much effect, which may be subject to further
clean-up.

Thanks, will queue.


      reply	other threads:[~2025-05-12 17:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-10 23:09 [PATCH] t1001: replace 'test -f' with 'test_path_is_file' Rodrigo Carvalho
2025-05-12 17:09 ` Junio C Hamano [this message]

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=xmqqldr1u56w.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=rodrigorsdc@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;
as well as URLs for NNTP newsgroup(s).