]>
Commit | Line | Data |
---|---|---|
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 | ||
7 | if 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="" | |
12 | elif git config cvs.cvsroot >/dev/null ; then | |
c8d0286e | 13 | # authors file is at .git/cvs-authors |
2d20ee12 | 14 | set -- git cvsimport -a -d $(git config cvs.cvsroot) $(git config cvs.module) "$@" |
5b61754d | 15 | expected="Already up-to-date." |
19fbd939 MF |
16 | elif [[ -d CVS ]] && git rev-parse origin >/dev/null ; then |
17 | set -- git cvsimport -a | |
18 | expected="Already up-to-date." | |
5b61754d MF |
19 | else |
20 | set -- git pull "$@" | |
21 | expected="Already up-to-date." | |
22 | fi | |
23 | ||
24 | output=$( | |
25 | "$@" | tee /proc/$$/fd/1 | |
26 | _pipestatus=${PIPESTATUS[*]} | |
27 | [[ ${_pipestatus// /} -eq 0 ]] || exit 1 | |
28 | ) | |
29 | [[ ${output} == "${expected}" ]] && exit 0 | |
30 | ||
31 | git fsck | |
32 | git count-objects | |
33 | git gc --prune |