git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] t9801: replace test -f with test_path_is_file

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 4, 2021, 01:11 UTC
Message-ID
<xmqq8s73g1tr.fsf@gitster.c.googlers.com>
In-Reply-To
<20210302185056.65929-1-shubhunic@gmail.com>
Shubham Verma <shubhunic@gmail.com> writes:
Show 5 quoted lines
> -		test -f file1 &&
> -		test -f file2 &&
> +		test_path_is_file file1 &&
> +		test_path_is_file file2 &&
>  		test ! -f file3 &&

You chose not to touch the last one, which is the right thing to do. Replacing "test -f P" with "test_path_is_file P" can be done mechanically, but it takes understanding of what the test is doing to come up the correct replacement for "test ! -f P". It may be expecting P to be a directory, or it may be expecting P to be missing, for example.

Will queue.  Thanks.
Previous: Shubham Verma
Message 2 of 2 in “t9801: replace test -f with test_path_is_file”
  1. t9801: replace test -f with test_path_is_fileShubham Verma, Mar 2, 2021
  2. Junio C HamanoMar 4, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.