From 5d666a055c64eb752a4c3d588e4047cfa39c2ebc Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 24 Aug 2013 15:19:12 +1200 Subject: Remove arbitrary execution of git rev-parse output --- bash/bashrc.d/prompt.bash | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bash') 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 -- cgit v1.2.3