From: Oleg Broytman Date: Mon, 28 Dec 2020 13:18:42 +0000 (+0300) Subject: bash_prompt: minor refactoring X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=eca67a71533d0eb7a191aca02b8ab8a3b2fbadb5;p=dotfiles.git bash_prompt: minor refactoring Remove external `if`. --- 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