From 39e69e151951040b952b3c81d2ee40b827fd9abf Mon Sep 17 00:00:00 2001 From: Eric Sunshine Date: Fri, 17 Jul 2015 19:00:01 -0400 Subject: [PATCH] checkout: check_linked_checkout: improve "already checked out" aesthetic When check_linked_checkout() discovers that the branch is already checked out elsewhere, it emits the diagnostic: 'blorp' is already checked out at '/some/path/.git' which is misleading since "checked out at" implies the working tree, but ".git" is the location of the repository administrative files. Fix by dropping ".git" from the message. Signed-off-by: Eric Sunshine Signed-off-by: Junio C Hamano --- builtin/checkout.c | 1 + 1 file changed, 1 insertion(+) diff --git a/builtin/checkout.c b/builtin/checkout.c index 177ad6a2d7..de6619f4c5 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -909,6 +909,7 @@ static void check_linked_checkout(const char *branch, const char *id) } else strbuf_addstr(&gitdir, get_git_common_dir()); skip_prefix(branch, "refs/heads/", &branch); + strbuf_strip_suffix(&gitdir, ".git"); die(_("'%s' is already checked out at '%s'"), branch, gitdir.buf); done: strbuf_release(&path); -- 2.11.4.GIT