checkout: name check_linked_checkouts() more meaningfully

check_linked_checkouts() doesn't just "check" linked checkouts for "something"; specifically, it aborts the operation if the branch about to be checked out is already checked out elsewhere. Therefore, rename it to die_if_checked_out() to give a better indication of its function. The more meaningful name will be particularly important when this function is later published for use by other callers. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Eric Sunshine committed Jul 17, 2015 at 18:59 UTC e13d37094e3b2ceb51dab362b8e2e1ad9e4bb758
1 file changed +2 -2
builtin/checkout.c
+2 -2
@@ -910,7 +910,7 @@ done:
910 strbuf_release(&gitdir);
911 }
912
913 -static void check_linked_checkouts(struct branch_info *new)
913 +static void die_if_checked_out(struct branch_info *new)
914 {
915 struct strbuf path = STRBUF_INIT;
916 DIR *dir;
@@ -1152,7 +1152,7 @@ static int checkout_branch(struct checkout_opts *opts,
1152 char *head_ref = resolve_refdup("HEAD", 0, sha1, &flag);
1153 if (head_ref &&
1154 (!(flag & REF_ISSYMREF) || strcmp(head_ref, new->path)))
1155 - check_linked_checkouts(new);
1155 + die_if_checked_out(new);
1156 free(head_ref);
1157 }
1158