From bc49d5dca53c224a0033b297d8555ff9a86cf615 Mon Sep 17 00:00:00 2001 From: Arialdo Martini Date: Thu, 14 Nov 2013 13:11:19 +0100 Subject: [PATCH] The if works with git v1.8 --- base.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base.sh b/base.sh index d5afa8f..492aa9b 100644 --- a/base.sh +++ b/base.sh @@ -26,8 +26,8 @@ function build_prompt { just_init=true else upstream=$(git rev-parse --symbolic-full-name --abbrev-ref @{upstream} 2> /dev/null) - if [ -n $upstream -a "$upstream" != "@{upstream}" ]; then has_upstream=true; else has_upstream=false; fi - + if [[ -n "${upstream}" && "${upstream}" != "@{upstream}" ]]; then has_upstream=true; else has_upstream=false; fi + git_status=$(git status --porcelain 2> /dev/null) if [[ $git_status =~ ($'\n'|^).M ]]; then has_modifications=true; else has_modifications=false; fi