git prompt: replace question with explanation

The code in question displays GIT_DIR! if the user is inside the .git
directory of a repository that has a working directory.  Several git
commands won't work in that situation, so it's useful to warn the
user.
This commit is contained in:
Brian Gernhardt 2013-06-03 13:04:16 -04:00
parent 18e34902a5
commit 697c44a293

View file

@ -346,7 +346,7 @@ function __fish_git_prompt_current_branch --description "__fish_git_prompt helpe
set branch "($branch)"
end
# I honestly don't know when this is relevant
# Let user know they're inside the git dir of a non-bare repo
if test "true" = (git rev-parse --is-inside-git-dir ^/dev/null)
if test "false" = (git rev-parse --is-bare-repository ^/dev/null)
set branch "GIT_DIR!"