19
all_strategies='recur recursive octopus resolve stupid ours subtree'
20
default_twohead_strategies='recursive'
21
default_octopus_strategies='octopus'
22
-no_trivial_merge_strategies='ours subtree'
22
+no_fast_forward_strategies='subtree ours'
23
+no_trivial_strategies='recursive recur subtree ours'
24
use_strategies=
25
25
-index_merge=t
26
+allow_fast_forward=t
27
+allow_trivial_merge=t
28
29
dropsave() {
30
rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" \
267
268
for s in $use_strategies
269
do
268
- for nt in $no_trivial_merge_strategies
270
+ for ss in $no_fast_forward_strategies
271
do
272
case " $s " in
271
- *" $nt "*)
272
- index_merge=f
273
+ *" $ss "*)
274
+ allow_fast_forward=f
275
+ break
276
+ ;;
277
+ esac
278
+ done
279
+ for ss in $no_trivial_strategies
280
+ do
281
+ case " $s " in
282
+ *" $ss "*)
283
+ allow_trivial_merge=f
284
break
285
;;
286
esac
297
esac
298
echo "$head" >"$GIT_DIR/ORIG_HEAD"
299
289
-case "$index_merge,$#,$common,$no_commit" in
290
-f,*)
291
- # We've been told not to try anything clever. Skip to real merge.
292
- ;;
300
+case "$allow_fast_forward,$#,$common,$no_commit" in
301
?,*,'',*)
302
# No common ancestors found. We need a real merge.
303
;;
307
finish_up_to_date "Already up-to-date."
308
exit 0
309
;;
302
-?,1,"$head",*)
310
+t,1,"$head",*)
311
# Again the most common case of merging one remote.
312
echo "Updating $(git rev-parse --short $head)..$(git rev-parse --short $1)"
313
git update-index --refresh 2>/dev/null
330
# We are not doing octopus, not fast forward, and have only
331
# one common.
332
git update-index --refresh 2>/dev/null
325
- case " $use_strategies " in
326
- *' recursive '*|*' recur '*)
327
- : run merge later
328
- ;;
329
- *)
333
+ case "$allow_trivial_merge" in
334
+ t)
335
# See if it is really trivial.
336
git var GIT_COMMITTER_IDENT >/dev/null || exit
337
echo "Trying really trivial in-index merge..."