aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-08-24 15:19:12 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-08-24 15:19:12 +1200
commit5d666a055c64eb752a4c3d588e4047cfa39c2ebc (patch)
tree16cbfc9f6d6f8aee5bc7bcf076f66c91d510d861 /bash
parentPrevent re-completing word from within it (diff)
downloaddotfiles-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.bash6
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