X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-pull.sh;h=6caf1aad471bbf8f894ea20a80c3be082012648b;hb=a41e109c4bcd56537fc3801623b1aa0dd4e06f1c;hp=2358af62d5eb008ef3d04de67cea7a56aab16526;hpb=7141b3b78099941f25b17388f56a917d4f7af51d;p=git.git diff --git a/git-pull.sh b/git-pull.sh old mode 100644 new mode 100755 index 2358af62..6caf1aad --- a/git-pull.sh +++ b/git-pull.sh @@ -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 one or more remote refs and merge it/them into the current HEAD. -' - exit 1 -} +USAGE='[-n | --no-summary] [--no-commit] [-s strategy]... [] ...' +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,22 @@ case "$merge_head" in exit 0 ;; ?*' '?*) - strategy_default_args='-s octopus' + var=`git repo-config --get pull.octopus` + if test '' = "$var" + then + strategy_default_args='-s octopus' + else + strategy_default_args="-s $var" + fi ;; *) - strategy_default_args='-s resolve' + var=`git repo-config --get pull.twohead` + if test '' = "$var" + then + strategy_default_args='-s recursive' + else + strategy_default_args="-s $var" + fi ;; esac