Date: Thu Apr 14 08:26:38 2005 +0200
[git/mingw.git] / git-pull-script
blob78d2f3df346b7b8d24b3dbe28a244b8d0ba141e7
1 #!/bin/sh
3 merge_repo=$1
4 merge_name=${2:-HEAD}
6 download_one () {
7 # remote_path="$1" local_file="$2"
8 case "$1" in
9 http://*)
10 wget -q -O "$2" "$1" ;;
11 /*)
12 test -f "$1" && cat >"$2" "$1" ;;
14 rsync -L "$1" "$2" ;;
15 esac
18 download_objects () {
19 # remote_repo="$1" head_sha1="$2"
20 case "$1" in
21 http://*)
22 git-http-pull -a "$2" "$1/"
24 /*)
25 git-local-pull -l -a "$2" "$1/"
28 rsync -avz --ignore-existing "$1/objects/." \
29 ${SHA_FILE_DIRECTORY:-.git/objects}/.
31 esac
34 echo "Getting remote $merge_name"
35 download_one "$merge_repo/$merge_name" .git/MERGE_HEAD
37 echo "Getting object database"
38 download_objects "$merge_repo" "$(cat .git/MERGE_HEAD)"
40 git-resolve-script "$(cat .git/HEAD)" "$(cat .git/MERGE_HEAD)" "$merge_repo"