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>
This commit is contained in:
Eric Sunshine 2015-07-17 19:00:01 -04:00 коммит произвёл Junio C Hamano
Родитель 4341460d92
Коммит 39e69e1519
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -909,6 +909,7 @@ static void check_linked_checkout(const char *branch, const char *id)
} else } else
strbuf_addstr(&gitdir, get_git_common_dir()); strbuf_addstr(&gitdir, get_git_common_dir());
skip_prefix(branch, "refs/heads/", &branch); skip_prefix(branch, "refs/heads/", &branch);
strbuf_strip_suffix(&gitdir, ".git");
die(_("'%s' is already checked out at '%s'"), branch, gitdir.buf); die(_("'%s' is already checked out at '%s'"), branch, gitdir.buf);
done: done:
strbuf_release(&path); strbuf_release(&path);