Linus Torvalds | 839a7a0 | 2005-04-18 12:15:10 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
Junio C Hamano | 521003f | 2005-08-22 21:57:59 -0700 | [diff] [blame^] | 3 | # Copyright (c) 2005 Junio C Hamano |
| 4 | # |
| 5 | # Fetch one or more remote refs and merge it/them into the current HEAD. |
| 6 | |
Linus Torvalds | b33e966 | 2005-07-08 10:57:21 -0700 | [diff] [blame] | 7 | . git-sh-setup-script || die "Not a git archive" |
Junio C Hamano | f170e4b | 2005-07-16 00:16:24 -0700 | [diff] [blame] | 8 | git-fetch-script "$@" || exit 1 |
Junio C Hamano | e0bfc81 | 2005-08-20 02:57:26 -0700 | [diff] [blame] | 9 | merge_head=$(sed -e 's/ .*//' "$GIT_DIR"/FETCH_HEAD | tr '\012' ' ') |
| 10 | merge_name=$(sed -e 's/^[0-9a-f]* //' "$GIT_DIR"/FETCH_HEAD | |
| 11 | tr '\012' ' ') |
| 12 | |
| 13 | case "$merge_head" in |
Junio C Hamano | 521003f | 2005-08-22 21:57:59 -0700 | [diff] [blame^] | 14 | '') |
| 15 | echo >&2 "No changes." |
| 16 | exit 0 |
| 17 | ;; |
| 18 | *' '?*) |
| 19 | echo >&2 "Pulling more than one heads; making an Octopus." |
| 20 | exec git-octopus-script |
| 21 | ;; |
Junio C Hamano | e0bfc81 | 2005-08-20 02:57:26 -0700 | [diff] [blame] | 22 | esac |
| 23 | |
Junio C Hamano | 8ac069a | 2005-05-09 22:57:58 -0700 | [diff] [blame] | 24 | git-resolve-script \ |
| 25 | "$(cat "$GIT_DIR"/HEAD)" \ |
Junio C Hamano | e0bfc81 | 2005-08-20 02:57:26 -0700 | [diff] [blame] | 26 | $merge_head "Merge $merge_name" |