#!/bin/bash -e #if [[ $(git branch | awk '($1 == "*") {print $2}') != master ]] ; then # echo "Switch to master first" # exit 1 #fi if git config svn-remote.svn.url >/dev/null ; then set -- git svn fetch --all "$@" expected="" elif git config cvs.cvsroot >/dev/null ; then set -- git cvsimport -a -d $(git config cvs.cvsroot) $(git config cvs.module) "$@" expected="Already up-to-date." else set -- git pull "$@" expected="Already up-to-date." fi output=$( "$@" | tee /proc/$$/fd/1 _pipestatus=${PIPESTATUS[*]} [[ ${_pipestatus// /} -eq 0 ]] || exit 1 ) [[ ${output} == "${expected}" ]] && exit 0 git fsck git count-objects git gc --prune