2 # Helper script for various git mirrors of other VCS types.
3 # I'm lazy and can't be bothered to remember the exact invocation.
5 #if [[ $(git branch | awk '($1 == "*") {print $2}') != master ]] ; then
6 # echo "Switch to master first"
16 if git config svn-remote.svn.url
>/dev
/null
; then
17 # git-config uses svn.authorsfile relative to repo root
18 # i.e. good to use .git/authors
19 set -- git svn fetch
--all "$@"
21 elif git config remote.hg.url
>/dev
/null
; then
23 $
(git config
--get --bool remote.hg.force
) && set -- "$@" --force
24 $
(git config
--get --bool remote.hg.rebase
) && set -- "$@" --rebase
25 elif git config cvs.cvsroot
>/dev
/null
; then
26 # authors file is at .git/cvs-authors
27 set -- git cvsimport
-a -d $
(git config cvs.cvsroot
) $
(git config cvs.module
) "$@"
28 expected
="Already up-to-date."
29 elif [[ -d CVS
]] && git rev-parse origin
>/dev
/null
; then
30 set -- git cvsimport
-a
31 expected
="Already up-to-date."
34 expected
="Already up-to-date."
38 "$@" |
tee /proc
/$$
/fd
/1
39 _pipestatus
=${PIPESTATUS[*]}
40 [[ ${_pipestatus// /} -eq 0 ]] ||
exit 1
42 [[ ${output} == "${expected}" ]] && exit 0