diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2013-08-24 15:19:12 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2013-08-24 15:19:12 +1200 |
commit | 5d666a055c64eb752a4c3d588e4047cfa39c2ebc (patch) | |
tree | 16cbfc9f6d6f8aee5bc7bcf076f66c91d510d861 /bash | |
parent | Prevent re-completing word from within it (diff) | |
download | dotfiles-5d666a055c64eb752a4c3d588e4047cfa39c2ebc.tar.gz dotfiles-5d666a055c64eb752a4c3d588e4047cfa39c2ebc.zip |
Remove arbitrary execution of git rev-parse output
Diffstat (limited to 'bash')
-rw-r--r-- | bash/bashrc.d/prompt.bash | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash index 4a657508..779eeed3 100644 --- a/bash/bashrc.d/prompt.bash +++ b/bash/bashrc.d/prompt.bash @@ -39,12 +39,14 @@ prompt() { git) # Exit if inside a .git directory - if $(git rev-parse --is-inside-git-dir 2>/dev/null); then + local isgd=$(git rev-parse --is-inside-git-dir 2>/dev/null) + if [[ $isgd == true ]]; then return 1 fi # Exit if not inside a working tree - if ! $(git rev-parse --is-inside-work-tree 2>/dev/null); then + local iswt=$(git rev-parse --is-inside-work-tree 2>/dev/null) + if [[ $iswt != true ]]; then return 1 fi |