diff options
author | Eric Sunshine <sunshine@sunshineco.com> | 2015-07-17 19:00:01 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-07-20 11:29:24 -0700 |
commit | 39e69e151951040b952b3c81d2ee40b827fd9abf (patch) | |
tree | 5263e42a3072e7559e1e467ed9909fbe14285848 /builtin/checkout.c | |
parent | checkout: generalize die_if_checked_out() branch name argument (diff) | |
download | tgif-39e69e151951040b952b3c81d2ee40b827fd9abf.tar.xz |
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 <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/checkout.c')
-rw-r--r-- | builtin/checkout.c | 1 |
1 files changed, 1 insertions, 0 deletions
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); |