From d962afb25af419a216633676abfb9fc3bbda4bc6 Mon Sep 17 00:00:00 2001 From: Yehor Lvivski Date: Wed, 6 Nov 2013 21:59:08 +0200 Subject: [PATCH] remove useless assignments --- prompt.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/prompt.sh b/prompt.sh index 42e8115..0a75d19 100644 --- a/prompt.sh +++ b/prompt.sh @@ -95,16 +95,14 @@ function build_prompt { tag_at_current_commit=$(git describe --exact-match --tags ${current_commit_hash} 2> /dev/null) if [[ -n "${tag_at_current_commit}" ]]; then is_on_a_tag=true; else is_on_a_tag=false; fi - commits_ahead=0 - commits_behind=0 has_diverged=false can_fast_forward=false can_fast_forward=false - commits=$(git log --pretty=oneline --topo-order --left-right ${current_commit_hash}...${upstream} 2> /dev/null) + commits_diff=$(git log --pretty=oneline --topo-order --left-right ${current_commit_hash}...${upstream} 2> /dev/null) - commits_ahead=$(echo ${commits} | grep -c "^<" ) - commits_behind=$(echo ${commits} | grep -c "^>" ) + commits_ahead=$(echo ${commits_diff} | grep -c "^<" ) + commits_behind=$(echo ${commits_diff} | grep -c "^>" ) if [ ${commits_ahead} -gt 0 -a ${commits_behind} -gt 0 ]; then has_diverged=true