diff options
Diffstat (limited to 'bash/bashrc.d/prompt.bash')
-rw-r--r-- | bash/bashrc.d/prompt.bash | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash index cd029a2e..a4d07f7e 100644 --- a/bash/bashrc.d/prompt.bash +++ b/bash/bashrc.d/prompt.bash @@ -97,8 +97,9 @@ prompt() { git) # Bail if we're not in a work tree--or, implicitly, if we don't # have git(1). - [[ $(git rev-parse --is-inside-work-tree 2>/dev/null) = true ]] || - return + local iswt + iswt=$(git rev-parse --is-inside-work-tree 2>/dev/null) + [[ $iswt = true ]] || return # Find a branch label, or a tag, or just show the short commit ID, # in that order of preference; if none of that works, bail out. |