summaryrefslogtreecommitdiff
path: root/git-pull.sh
diff options
context:
space:
mode:
Diffstat (limited to 'git-pull.sh')
-rwxr-xr-xgit-pull.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/git-pull.sh b/git-pull.sh
index 580d63336e..1f777de2d7 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -62,7 +62,7 @@ then
echo "Please use pull.mode and branch.<name>.pullmode instead."
fi
fi
-test -z "$mode" && mode=merge
+test -z "$mode" && mode=default
dry_run=
while :
do
@@ -286,12 +286,21 @@ case "$merge_head" in
*)
# check if a non-fast-foward merge would be needed
merge_head=${merge_head% }
- if test "$mode" = merge-ff-only -a -z "$no_ff$ff_only${squash#--no-squash}" &&
+ if test -z "$no_ff$ff_only${squash#--no-squash}" &&
test -n "$orig_head" &&
! git merge-base --is-ancestor "$orig_head" "$merge_head" &&
! git merge-base --is-ancestor "$merge_head" "$orig_head"
then
- die "The pull was not fast-forward, please either merge or rebase."
+ case "$mode" in
+ merge-ff-only)
+ die "The pull was not fast-forward, please either merge or rebase."
+ ;;
+ default)
+ say "The pull was not fast-forward, in the future you would have to choose
+a merge or a rebase, falling back to old style for now (git pull --merge).
+Read 'git pull --help' for more information."
+ ;;
+ esac
fi
;;
esac