Re: [RFC v2 1/1] refspec: add support for negative refspecs
- From
Jacob Keller <jacob.keller@gmail.com>
- Date
- Sep 24, 2020, 23:42 UTC
- Message-ID
- <CA+P7+xqJis+DA=ZZ0Qphf0P8RGVbXyvHUHaqo30LQDytxAvs-w@mail.gmail.com>
- In-Reply-To
- <xmqqzh5onea1.fsf@gitster.c.googlers.com>
On Thu, Sep 17, 2020 at 5:02 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 17 quoted lines
> > Jacob Keller <jacob.e.keller@intel.com> writes: > > > @@ -1441,6 +1559,8 @@ int match_push_refs(struct ref *src, struct ref **dst, > > string_list_clear(&src_ref_index, 0); > > } > > > > + *dst = apply_negative_refspecs(*dst, rs); > > + > > if (errs) > > return -1; > > return 0; > > And after grabbing all the candidate refs to be updated via this > push, we filter out the ones that match negative pattern. Can it > also produce an error, or it can never fail (to udpate errs)? >
It can't fail. Either refs match a negative refspec and will get excluded, or they do not match a negative refspec and will be kept. We already validate the negative refspecs earlier.
Thanks, Jake