worktrees: add find_shared_symref
commit41af65651d4333cd19ab4af3509fa2d08f3816ed
authorDavid Turner <dturner@twopensource.com>
Mon, 10 Aug 2015 17:52:44 +0000 (10 13:52 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 Aug 2015 20:48:15 +0000 (11 13:48 -0700)
tree19a55a6e2d48d20fc6bee7f6f2a99f3ae7ba8f0d
parent65f9b75dfe34a67cf4c6a8507f999c5710d36ba9
worktrees: add find_shared_symref

Add a new function, find_shared_symref, which contains the heart of
die_if_checked_out, but works for any symref, not just HEAD.  Refactor
die_if_checked_out to use the same infrastructure as
find_shared_symref.

Soon, we will use find_shared_symref to protect notes merges in
worktrees.

Signed-off-by: David Turner <dturner@twopensource.com>
Reviewed-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
branch.c
branch.h