]> git.phdru.name Git - dotfiles.git/commitdiff
bash_prompt: minor refactoring
authorOleg Broytman <phd@phdru.name>
Mon, 28 Dec 2020 13:18:42 +0000 (16:18 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 28 Dec 2020 13:18:42 +0000 (16:18 +0300)
Remove external `if`.

admin/prog/bash_prompt

index aedf458e7b192eb600b5774c0d843fefb1e1cc9b..b89d340e23b72eef93aadd2fe33bf6ea2fe38304 100644 (file)
@@ -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