Merge branch 'jc/clone' into next
[git.git] / git-pull.sh
index 2358af6..29c14e1 100755 (executable)
@@ -4,18 +4,9 @@
 #
 # Fetch one or more remote refs and merge it/them into the current HEAD.
 
-. git-sh-setup || die "Not a git archive"
-
-usage () {
-    echo >&2 "usage: $0"' [-n] [--no-commit] [--no-summary] [--help]
-    [-s strategy]...
-    [<fetch-options>]
-    <repo> <head>...
-
-Fetch one or more remote refs and merge it/them into the current HEAD.
-'
-    exit 1
-}
+USAGE='[-n | --no-summary] [--no-commit] [-s strategy]... [<fetch-options>] <repo> <head>...'
+LONG_USAGE='Fetch one or more remote refs and merge it/them into the current HEAD.'
+. git-sh-setup
 
 strategy_args= no_summary= no_commit=
 while case "$#,$1" in 0) break ;; *,-*) ;; *) break ;; esac
@@ -79,10 +70,18 @@ case "$merge_head" in
        exit 0
        ;;
 ?*' '?*)
-       strategy_default_args='-s octopus'
+       var=`git-repo-config --get pull.octopus`
+       if test -n "$var"
+       then
+               strategy_default_args="-s $var"
+       fi
        ;;
 *)
-       strategy_default_args='-s resolve'
+       var=`git-repo-config --get pull.twohead`
+       if test -n "$var"
+        then
+               strategy_default_args="-s $var"
+       fi
        ;;
 esac