File tree Expand file tree Collapse file tree 1 file changed +44
-4
lines changed Expand file tree Collapse file tree 1 file changed +44
-4
lines changed Original file line number Diff line number Diff line change 6
6
7
7
. git-sh-setup || die " Not a git archive"
8
8
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
+
9
41
orig_head=$( git-rev-parse --verify HEAD) || die " Pulling into a black hole?"
10
42
git-fetch --update-head-ok " $@ " || exit 1
11
43
@@ -33,11 +65,19 @@ case "$merge_head" in
33
65
echo >&2 " No changes."
34
66
exit 0
35
67
;;
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
39
79
;;
40
80
esac
41
81
42
82
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
You can’t perform that action at this time.
0 commit comments