Subject: Re: [PATCH] t0410: modernize delete_object helper

From: Junio C Hamano <[email-masked]>
Date: Thu, 12 Mar 2026 15:03:41 -0700

Jeff King <[email-masked]> writes:

> On Thu, Mar 12, 2026 at 06:20:30PM +0530, Siddharth Shrimali wrote:
>
>>  delete_object () {
>> -	rm $1/.git/objects/$(echo $2 | sed -e 's|^..|&/|')
>> +	repo=$1
>> +	obj=$2
>> +	path="$repo/.git/objects/$(test_oid_to_path $obj)" &&
>> +	test_path_is_file "$path" &&
>> +	rm "$path"
>>  }
>
> It might worth marking these new variables with "local". They are not
> used elsewhere by the script currently, but they are common enough names
> that a collision in the future doesn't seem that unlikely.

Yes, and another thing that was pointed out is it is dubious to use
test_path_is_file here, as "rm" would be loud enough when it fails.