]> git.wh0rd.org - home.git/blame - .bin/git-update
installkernel: improve s390 logic
[home.git] / .bin / git-update
CommitLineData
5b61754d
MF
1#!/bin/bash -e
2#if [[ $(git branch | awk '($1 == "*") {print $2}') != master ]] ; then
3# echo "Switch to master first"
4# exit 1
5#fi
6
7if git config svn-remote.svn.url >/dev/null ; then
c8d0286e
MF
8 # git-config uses svn.authorsfile relative to repo root
9 # i.e. good to use .git/authors
5b61754d
MF
10 set -- git svn fetch --all "$@"
11 expected=""
f45b2012
MF
12elif git config remote.hg.url >/dev/null ; then
13 git-hg pull
5b61754d 14elif git config cvs.cvsroot >/dev/null ; then
c8d0286e 15 # authors file is at .git/cvs-authors
2d20ee12 16 set -- git cvsimport -a -d $(git config cvs.cvsroot) $(git config cvs.module) "$@"
5b61754d 17 expected="Already up-to-date."
19fbd939
MF
18elif [[ -d CVS ]] && git rev-parse origin >/dev/null ; then
19 set -- git cvsimport -a
20 expected="Already up-to-date."
5b61754d
MF
21else
22 set -- git pull "$@"
23 expected="Already up-to-date."
24fi
25
26output=$(
27 "$@" | tee /proc/$$/fd/1
28 _pipestatus=${PIPESTATUS[*]}
29 [[ ${_pipestatus// /} -eq 0 ]] || exit 1
30)
31[[ ${output} == "${expected}" ]] && exit 0
32
33git fsck
34git count-objects
35git gc --prune