From fd8f5050d4be0eb171710b026e071ca410dac14f Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Tue, 9 Dec 2014 13:44:38 +0100 Subject: [PATCH] Case is unneeded, simple if statement --- .bashrc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.bashrc b/.bashrc index d1cad84..9caa3d5 100644 --- a/.bashrc +++ b/.bashrc @@ -57,6 +57,7 @@ if [ -n "$force_color_prompt" ]; then fi # http://stackoverflow.com/questions/4023830/bash-how-compare-two-strings-in-version-format +# returns 0 if =, 1 if >, 2 if < vercomp () { if [[ $1 == $2 ]] then @@ -90,11 +91,10 @@ vercomp () { # check version of git; it supports 'simple' from 1.7.11 up, fall back to 'matching' vercomp "1.7.11" `git --version|awk '{ print $3 }'` -case $? in - 0) op='=';; - 1) git config --global push.default matching; git config --global pull.default matching ;; # op='>';; - 2) op='<';; -esac +if [ $? -eq 1 ]; then + git config --global push.default matching + git config --global pull.default matching +fi hg_ps1() { #hg prompt "{ on {branch}}{ at {bookmark}}{status}" 2> /dev/null