Skip to content

Commit 09dea56

Browse files
author
Peter Anvin
committed
Merge with master.kernel.org:/pub/scm/git/git.git
2 parents fef1ef8 + 60fb5b2 commit 09dea56

File tree

1 file changed

+44
-4
lines changed

1 file changed

+44
-4
lines changed

git-pull.sh

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,38 @@
66

77
. git-sh-setup || die "Not a git archive"
88

9+
usage () {
10+
die "git pull [-n] [-s strategy]... <repo> <head>..."
11+
}
12+
13+
strategy_args= no_summary=
14+
while case "$#,$1" in 0) break ;; *,-*) ;; *) break ;; esac
15+
do
16+
case "$1" in
17+
-n|--n|--no|--no-|--no-s|--no-su|--no-sum|--no-summ|\
18+
--no-summa|--no-summar|--no-summary)
19+
no_summary=-n ;;
20+
-s=*|--s=*|--st=*|--str=*|--stra=*|--strat=*|--strate=*|\
21+
--strateg=*|--strategy=*|\
22+
-s|--s|--st|--str|--stra|--strat|--strate|--strateg|--strategy)
23+
case "$#,$1" in
24+
*,*=*)
25+
strategy=`expr "$1" : '-[^=]*=\(.*\)'` ;;
26+
1,*)
27+
usage ;;
28+
*)
29+
strategy="$2"
30+
shift ;;
31+
esac
32+
strategy_args="${strategy_args}-s $strategy "
33+
;;
34+
-*)
35+
usage
36+
;;
37+
esac
38+
shift
39+
done
40+
941
orig_head=$(git-rev-parse --verify HEAD) || die "Pulling into a black hole?"
1042
git-fetch --update-head-ok "$@" || exit 1
1143

@@ -33,11 +65,19 @@ case "$merge_head" in
3365
echo >&2 "No changes."
3466
exit 0
3567
;;
36-
*' '?*)
37-
echo >&2 "Pulling more than one heads; making an Octopus."
38-
exec git-octopus
68+
?*' '?*)
69+
strategy_default_args='-s octopus'
70+
;;
71+
*)
72+
strategy_default_args='-s resolve'
73+
;;
74+
esac
75+
76+
case "$strategy_args" in
77+
'')
78+
strategy_args=$strategy_default_args
3979
;;
4080
esac
4181

4282
merge_name=$(git-fmt-merge-msg <"$GIT_DIR/FETCH_HEAD")
43-
git-resolve "$curr_head" $merge_head "$merge_name"
83+
git-merge $no_summary $strategy_args "$merge_name" HEAD $merge_head

0 commit comments

Comments
 (0)