Re: [PATCH] promisor-remote: skip move_to_tail when n=1

2019-09-26 Thread Jeff King
On Thu, Sep 26, 2019 at 10:53:08AM -0700, Emily Shaffer wrote: > > should probably just see if we're already at the end, which also covers > > the single-element case. Like: > > > > if (!r->next) > > return; /* we're already at the end */ > > Hmm, I guess I wasn't familiar enough on the li

Re: [PATCH] promisor-remote: skip move_to_tail when n=1

2019-09-26 Thread Emily Shaffer
On Thu, Sep 26, 2019 at 03:55:35AM -0400, Jeff King wrote: > On Wed, Sep 25, 2019 at 02:37:18PM -0700, Emily Shaffer wrote: > > > Previously, when promisor_remote_move_to_tail() is called for a > > promisor_remote which is currently the *only* element in promisors, a > > cycle is created in the pr

Re: [PATCH] promisor-remote: skip move_to_tail when n=1

2019-09-26 Thread Jeff King
On Wed, Sep 25, 2019 at 02:37:18PM -0700, Emily Shaffer wrote: > Previously, when promisor_remote_move_to_tail() is called for a > promisor_remote which is currently the *only* element in promisors, a > cycle is created in the promisors linked list. This cycle leads to a > double free later on in

[PATCH] promisor-remote: skip move_to_tail when n=1

2019-09-25 Thread Emily Shaffer
Previously, when promisor_remote_move_to_tail() is called for a promisor_remote which is currently the *only* element in promisors, a cycle is created in the promisors linked list. This cycle leads to a double free later on in promisor_remote_clear(): promisors is set to promisors->next (a no-op, a