From eca67a71533d0eb7a191aca02b8ab8a3b2fbadb5 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 28 Dec 2020 16:18:42 +0300 Subject: [PATCH] bash_prompt: minor refactoring Remove external `if`. --- admin/prog/bash_prompt | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/admin/prog/bash_prompt b/admin/prog/bash_prompt index aedf458..b89d340 100644 --- a/admin/prog/bash_prompt +++ b/admin/prog/bash_prompt @@ -75,13 +75,11 @@ prompt_git() { set -- `git rev-list --count --left-right @{u}...HEAD` left=$1 right=$2 - if [ "$left" -gt 0 -o "$right" -gt 0 ]; then - if [ "$left" -gt 0 ]; then - s="$s-$left" - fi - if [ "$right" -gt 0 ]; then - s="$s+$right" - fi + if [ "$left" -gt 0 ]; then + s="$s-$left" + fi + if [ "$right" -gt 0 ]; then + s="$s+$right" fi fi -- 2.39.5