1#!/bin/sh
2#
3. git-sh-setup-script || die "Not a git archive"
4. git-parse-remote "$@"
5merge_repo="$_remote_repo"
6merge_head="$_remote_head"
7merge_store="$_remote_store"
89
TMP_HEAD="$GIT_DIR/TMP_HEAD"
1011
case "$merge_repo" in
12http://*)
13head=$(wget -q -O - "$merge_repo/$merge_head") || exit 1
14echo Fetching "$merge_head" using http
15git-http-pull -v -a "$merge_head" "$merge_repo/"
16;;
17rsync://*)
18rsync -L "$merge_repo/$merge_head" "$TMP_HEAD" || exit 1
19head=$(git-rev-parse TMP_HEAD)
20rm -f "$TMP_HEAD"
21rsync -avz --ignore-existing "$merge_repo/objects/" "$GIT_OBJECT_DIRECTORY/"
22;;
23*)
24head=$(git-fetch-pack "$merge_repo" "$merge_head")
25;;
26esac || exit 1
2728
git-rev-parse --verify "$head" > /dev/null || exit 1
2930
case "$merge_store" in
31'')
32echo "$head" > "$GIT_DIR/$merge_store"
33esac &&
3435
# FETCH_HEAD is fed to git-resolve-script which will eventually be
36# passed to git-commit-tree as one of the parents. Make sure we do
37# not give a tag object ID.
3839
git-rev-parse "$head^0" >"$GIT_DIR/FETCH_HEAD"