Re: [PATCH v7 4/8] worktree: simplify find_shared_symref() memory ownership model
- From
Anders Kaseorg <andersk@mit.edu>
- Date
- Dec 1, 2021, 23:47 UTC
- Message-ID
- <f8262c3b-2ca5-4920-1379-41ff29b37d9f@mit.edu>
- In-Reply-To
- <CAPig+cSNP-RBmsWWfT690-shFUCZ3J0X+FBiNjCqg=AkoBMBqQ@mail.gmail.com>
On 12/1/21 15:10, Eric Sunshine wrote:
> As far as I can see, this code only cares whether find_shared_symref() > returned a result; it doesn't actually consult the returned worktree > at all, thus it semantically considers `worktree` as a boolean, not as > a `struct worktree`.
No, the update_worktree(new_oid->hash, worktree) call uses it in a non-boolean way, so we do need to keep it around.
Anders