Skip to content

Commit 39e69e1

Browse files
sunshinecogitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4341460 commit 39e69e1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

builtin/checkout.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,7 @@ static void check_linked_checkout(const char *branch, const char *id)
909909
} else
910910
strbuf_addstr(&gitdir, get_git_common_dir());
911911
skip_prefix(branch, "refs/heads/", &branch);
912+
strbuf_strip_suffix(&gitdir, ".git");
912913
die(_("'%s' is already checked out at '%s'"), branch, gitdir.buf);
913914
done:
914915
strbuf_release(&path);

0 commit comments

Comments
 (0)