From: Junio C Hamano Date: Tue, 04 Mar 2025 12:05:31 GMT Subject: Re: [PATCH 1/1] t1403: prefer test_path_exists helper function Message-ID: In-Reply-To: Mahendra Dani writes: >> > remove_object() { >> > file=$(sha1_file "$*") && >> > - test -e "$file" && >> > + test_path_exists "$file" && >> > rm -f "$file" >> > } && >> >> The refactoring is true to the original spirit of the preimage indeed. >> But we could also improve it even further if we verified that the path >> not only exists, but exists and is a file via `test_path_is_file()`. If >> we decide to do that we should also explain the change in the commit >> message. > > Yes, sure. > I will improve it further using the `test_path_is_file()` helper > function and change the commit message in v2 patch. You may want to think about why there is "-f" there. If we remove it, do we still need to have any check there?