subtree: force merge commit

When `merge.ff` is set to `only` in .gitconfig, `git subtree pull` will fail with error `fatal: Not possible to fast-forward, aborting.`, but the command does want to make merges in these places. Add `--no-ff` argument to `git merge` to enforce this behaviour. Signed-off-by: Thomas Koutcher <thomas.koutcher@online.fr> Reviewed-by: Johannes Altmanninger <aclopte@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Thomas Koutcher committed Feb 1, 2022 at 18:26 UTC 9158a3564a970def3375a79e8f3f90927cd8e793
1 file changed +2 -2
contrib/subtree/git-subtree.sh
+2 -2
@@ -975,10 +975,10 @@ cmd_merge () {
975
976 if test -n "$arg_addmerge_message"
977 then
978 - git merge -Xsubtree="$arg_prefix" \
978 + git merge --no-ff -Xsubtree="$arg_prefix" \
979 --message="$arg_addmerge_message" "$rev"
980 else
981 - git merge -Xsubtree="$arg_prefix" $rev
981 + git merge --no-ff -Xsubtree="$arg_prefix" $rev
982 fi
983 }
984