Re: [PATCH 1/3] for-each-ref: let upstream/push optionally report the remote name
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 4, 2017, 09:08 UTC
- Message-ID
- <xmqq7ewbb7qq.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <xmqq376zcrls.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 9 quoted lines
>> + } else if (atom->u.remote_ref.option == RR_REMOTE_NAME) {
>> + int explicit;
>> + const char *remote = starts_with(atom->name, "push") ?
>> + pushremote_for_branch(branch, &explicit) :
>> + remote_for_branch(branch, &explicit);
>
> I think "int explicit = 0;" is needed, as pushremote_for_branch()
> does seem to expect that the "explicit" return parameter is
> initialized by the caller.Not really. I misread these helper functions. pushremote_for_branch() ends up calling remote_for_branch() which does clear, so we are OK without caller initializing it.