Re: [PATCH v2] fetch: limit shared symref check only for local branches
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 18, 2022, 15:50 UTC
- Message-ID
- <xmqqilq2yh49.fsf@gitster.g>
- In-Reply-To
- <CAGHpTBK_K+GK5z3XD-7ob7JPLrUnohfMCRVD2wrwbMhDyy3TEw@mail.gmail.com>
Orgad Shaneh <orgads@gmail.com> writes:
> This would require shuffling the code. check_not_current_branch() is > called by do_fetch before fetch_and_consume_refs (which updates > ref->old_oid and ref->new_oid).
Oh, that's unfortunate.
We may not be matching them with the current values of the local copies in ref_map in today's code until fetch_and_consume_refs() calls store_updated_refs() to update the .new_oid member, but I would have thought that we learned the equivalent of "git ls-remote" output a lot earlier, at least most of the time, via a call to transport_get_remote_refs(), and that was why I thought such an optimization was doable.
Thanks.