1
0
mirror of https://github.com/aquatix/dotfiles.git synced 2025-12-06 21:45:10 +01:00

Case is unneeded, simple if statement

This commit is contained in:
Michiel Scholten
2014-12-09 13:44:38 +01:00
parent 2650f61fdc
commit fd8f5050d4

10
.bashrc
View File

@@ -57,6 +57,7 @@ if [ -n "$force_color_prompt" ]; then
fi fi
# http://stackoverflow.com/questions/4023830/bash-how-compare-two-strings-in-version-format # http://stackoverflow.com/questions/4023830/bash-how-compare-two-strings-in-version-format
# returns 0 if =, 1 if >, 2 if <
vercomp () { vercomp () {
if [[ $1 == $2 ]] if [[ $1 == $2 ]]
then then
@@ -90,11 +91,10 @@ vercomp () {
# check version of git; it supports 'simple' from 1.7.11 up, fall back to 'matching' # 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 }'` vercomp "1.7.11" `git --version|awk '{ print $3 }'`
case $? in if [ $? -eq 1 ]; then
0) op='=';; git config --global push.default matching
1) git config --global push.default matching; git config --global pull.default matching ;; # op='>';; git config --global pull.default matching
2) op='<';; fi
esac
hg_ps1() { hg_ps1() {
#hg prompt "{ on {branch}}{ at {bookmark}}{status}" 2> /dev/null #hg prompt "{ on {branch}}{ at {bookmark}}{status}" 2> /dev/null