Honor pull.{twohead,octopus} in git-merge.
authorShawn O. Pearce <spearce@spearce.org>
Thu, 28 Dec 2006 07:35:05 +0000 (02:35 -0500)
committerJunio C Hamano <junkio@cox.net>
Thu, 28 Dec 2006 09:07:51 +0000 (01:07 -0800)
If git-merge is invoked without a strategy argument it is probably
being run as a porcelain-ish command directly and is not being run
from within git-pull.  However we still should honor whatever merge
strategy the user may have selected in their configuration, just as
`git-pull .` would have.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-merge.sh

index e8db52725c2d5ea023ec6d875cdfbc7c20240a31..ba42260426296b63070a1fbdc22a9b77ea5ac412 100755 (executable)
@@ -227,9 +227,21 @@ case "$use_strategies" in
 '')
        case "$#" in
        1)
-               use_strategies="$default_twohead_strategies" ;;
+               var="`git-repo-config --get pull.twohead`"
+               if test -n "$var"
+               then
+                       use_strategies="$var"
+               else
+                       use_strategies="$default_twohead_strategies"
+               fi ;;
        *)
-               use_strategies="$default_octopus_strategies" ;;
+               var="`git-repo-config --get pull.octopus`"
+               if test -n "$var"
+               then
+                       use_strategies="$var"
+               else
+                       use_strategies="$default_octopus_strategies"
+               fi ;;
        esac
        ;;
 esac