diff options
author | Anders Kaseorg <andersk@mit.edu> | 2021-12-01 14:15:43 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-12-01 22:18:25 -0800 |
commit | c8dd491fa5b57ecfd9ef33ae5291eb2a9402cd59 (patch) | |
tree | b686f1bb1a587d214f3a19efa6d56b7c65d07ae2 /ws.c | |
parent | branch: lowercase error messages (diff) | |
download | tgif-c8dd491fa5b57ecfd9ef33ae5291eb2a9402cd59.tar.xz |
worktree: simplify find_shared_symref() memory ownership model
Storing the worktrees list in a static variable meant that
find_shared_symref() had to rebuild the list on each call (which is
inefficient when the call site is in a loop), and also that each call
invalidated the pointer returned by the previous call (which is
confusing).
Instead, make it the caller’s responsibility to pass in the worktrees
list and manage its lifetime.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ws.c')
0 files changed, 0 insertions, 0 deletions