Re: [PATCH v2 0/4] Never report references we not push
- From
Jiang Xin <worldhello.net@gmail.com>
- Date
- Mar 29, 2020, 14:35 UTC
- Message-ID
- <CANYiYbH1eaw6WT8qPfc3afwEDnv07uhq7_92VpdBgDKzZhFqcA@mail.gmail.com>
- In-Reply-To
- <20200329143329.13846-1-worldhello.net@gmail.com>
Jiang Xin <worldhello.net@gmail.com> 于2020年3月29日周日 下午10:33写道:
Show 5 quoted lines
> > ## Changes since v1: > > * Add a new common method `reject_atomic_push()`, which is reused for > atomic push rejection for SSH and HTTP protocol.
I first try to add some common methods in `transport_push()` of "transport.c", but I find it is hard to do this. Because the capabilities has not been set after calling `transport->vtable->get_refs_list` for HTTP protocol.
And for the same reason, the following code in `send-pack.c` cannot move to `set_ref_status_for_push()`.
/*
* NEEDSWORK: why does delete-refs have to be so specific to
* send-pack machinery that set_ref_status_for_push() cannot
* set this bit for us???
*/
for (ref = remote_refs; ref; ref = ref->next)
if (ref->deletion && !allow_deleting_refs)
ref->status = REF_STATUS_REJECT_NODELETEI wonder if we can extend method `get_refs_list()` of "transport-helper.c" and "remote-curl.c", so we can all method `server_supports()` in `transport_push()` of "transport.c".