worktree.c: make find_shared_symref() return struct worktree *
This gives the caller more information and they can answer things like, "is it the main worktree" or "is it the current worktree". The latter question is needed for the "checkout a rebase branch" case later. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
69dfe3b942
commit
d3b9ac07eb
@ -35,10 +35,10 @@ extern void free_worktrees(struct worktree **);
|
||||
|
||||
/*
|
||||
* Check if a per-worktree symref points to a ref in the main worktree
|
||||
* or any linked worktree, and return the path to the exising worktree
|
||||
* if it is. Returns NULL if there is no existing ref. The caller is
|
||||
* responsible for freeing the returned path.
|
||||
* or any linked worktree, and return the worktree that holds the ref,
|
||||
* or NULL otherwise. The result may be destroyed by the next call.
|
||||
*/
|
||||
extern char *find_shared_symref(const char *symref, const char *target);
|
||||
extern const struct worktree *find_shared_symref(const char *symref,
|
||||
const char *target);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user