diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-27 12:54:03 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-27 12:54:03 +1200 |
commit | 709367d0cf57e512b0914459b8893eb7dc9438f6 (patch) | |
tree | dbe725bdf3cd14cadb5d8782cecec2050dd62913 /bash/bashrc.d | |
parent | Rearrange ~/.xinitrc in some sort of order (diff) | |
download | dotfiles-709367d0cf57e512b0914459b8893eb7dc9438f6.tar.gz dotfiles-709367d0cf57e512b0914459b8893eb7dc9438f6.zip |
Use -n test and temp var for working tree test
Diffstat (limited to 'bash/bashrc.d')
-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. |