diff options
author | Eric Sunshine <sunshine@sunshineco.com> | 2015-07-18 02:00:01 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-07-20 21:29:24 +0300 |
commit | 39e69e151951040b952b3c81d2ee40b827fd9abf (patch) | |
tree | 5263e42a3072e7559e1e467ed9909fbe14285848 /builtin/checkout.c | |
parent | 4341460d92c2857193954158f35aaf7518aa7a58 (diff) |
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); |