Skip to content

Commit 9158a35

Browse files
koutchergitster
authored andcommitted
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>
1 parent 4c53a8c commit 9158a35

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/subtree/git-subtree.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -975,10 +975,10 @@ cmd_merge () {
975975

976976
if test -n "$arg_addmerge_message"
977977
then
978-
git merge -Xsubtree="$arg_prefix" \
978+
git merge --no-ff -Xsubtree="$arg_prefix" \
979979
--message="$arg_addmerge_message" "$rev"
980980
else
981-
git merge -Xsubtree="$arg_prefix" $rev
981+
git merge --no-ff -Xsubtree="$arg_prefix" $rev
982982
fi
983983
}
984984

0 commit comments

Comments
 (0)