Re: [PATCH] negative-refspec: fix segfault on : refspec
- From
Jacob Keller <jacob.keller@gmail.com>
- Date
- Feb 19, 2021, 09:28 UTC
- Message-ID
- <CA+P7+xrA1kCfJF1B13-yPKFgOKLQhcjQ+zJYpnqJuS5wOXk3wQ@mail.gmail.com>
- In-Reply-To
- <xmqqy2htoen9.fsf@gitster.c.googlers.com>
On Sat, Dec 19, 2020 at 10:05 AM Junio C Hamano <gitster@pobox.com> wrote:
> > Original author of the feature (Jacob) cc'ed for insight. >
Hi,
Sorry I missed this thread last couple months.
Show 17 quoted lines
> - Can we have refspec->src==NULL in cases other than where
> refspec->matching is true? If not, then perhaps the patch should
> insert, before the problematic "else if" clause, something like
>
> if (match_name_with_pattern(...))
> string_list_append_nodup(...);
> + } else if (refspec->matching) {
> + ... behaviour for the matching case ...
> + } else if (refspec->src == NULL) {
> + BUG("refspec->src cannot be null here");
> } else {
> if (!strcmp(needle, refspec->src))
>
> - We'd need to decide if ignoring is the right behaviour for the
> matching refspec. I do not recall what we decided the logic of
> the function should be offhand.
>Isn't this patch about how we somehow broke ":" on its own, not as a negative refspec?