Re: [PATCH 4/4] builtin/remote: only iterate through refs that are to be renamed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Patrick Steinhardt <ps@xxxxxx> writes:

> When renaming a remote we also need to rename all references
> accordingly. But while we only need to rename references that are
> contained in the "refs/remotes/$OLDNAME/" namespace, we end up using
> `refs_for_each_rawref()` that iterates through _all_ references. We know
> to exit early in the callback in case we see an irrelevant reference,
> but ultimately this is still a waste of compute as we knowingly iterate
> through references that we won't ever care about.

Very true.  Even if we guarantee that callbacks are fed references in
lexicographic order, that would only allow us to stop iterationg
when we see an irrelevant one", and still would force us to skip
over all the irrelevant ones until we see the first one in scope.

It makes perfect sense to give us a way to say "iterate only in this
subhierarchy" like this step does.

Nice.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux