From: Junio C Hamano <gitster@pobox.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: Siddharth Shrimali <r.siddharth.shrimali@gmail.com>,
git@vger.kernel.org, jonathantanmy@google.com,
christian.couder@gmail.com, karthik.188@gmail.com
Subject: Re: [PATCH] t0410: modernize delete_object helper
Date: Thu, 12 Mar 2026 12:09:05 -0700 [thread overview]
Message-ID: <xmqqo6kseuge.fsf@gitster.g> (raw)
In-Reply-To: <CAPig+cS3v=OT6BJ0WWh=qvWBm1TVck+O7eKd7gJ2fe_d5Rny_A@mail.gmail.com> (Eric Sunshine's message of "Thu, 12 Mar 2026 15:05:24 -0400")
Eric Sunshine <sunshine@sunshineco.com> writes:
>> diff --git a/t/t0410-partial-clone.sh b/t/t0410-partial-clone.sh
>> @@ -11,7 +11,11 @@ test_description='partial clone'
>> 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"
>> }
>
> Despite what the commit message says, adding a call to
> `test_path_is_file` here does not add value since `rm` will already
> fail noisily and exit with an error code if the path does not exist.
> Moreover, because it's unnecessary, the `test_path_is_file` invocation
> may confuse readers into thinking that something subtle is going on
> that requires extra scrutiny and care even though that's not the case.
> So let's not add this needless extra code.
Good to point this out. Use of test_oid_to_path would still be
good, though.
Thanks.
next prev parent reply other threads:[~2026-03-12 19:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-12 12:50 [PATCH] t0410: modernize delete_object helper Siddharth Shrimali
2026-03-12 14:17 ` Pushkar Singh
2026-03-12 19:05 ` Eric Sunshine
2026-03-12 19:09 ` Junio C Hamano [this message]
2026-03-12 20:33 ` Jeff King
2026-03-12 22:03 ` Junio C Hamano
2026-03-13 2:58 ` [PATCH v2] " Siddharth Shrimali
2026-03-13 4:58 ` Jeff King
2026-03-13 15:29 ` Junio C Hamano
2026-03-18 2:37 ` Jeff King
2026-03-13 5:31 ` [PATCH v3] " Siddharth Shrimali
2026-03-13 15:20 ` Junio C Hamano
2026-03-13 15:19 ` [PATCH v2] " 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=xmqqo6kseuge.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=jonathantanmy@google.com \
--cc=karthik.188@gmail.com \
--cc=r.siddharth.shrimali@gmail.com \
--cc=sunshine@sunshineco.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.