]> git.ipfire.org Git - thirdparty/git.git/commitdiff
subtree: force merge commit
authorThomas Koutcher <thomas.koutcher@online.fr>
Tue, 1 Feb 2022 17:26:04 +0000 (18:26 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 1 Feb 2022 19:31:51 +0000 (11:31 -0800)
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>
contrib/subtree/git-subtree.sh

index 71f1fd94bde8b0cd1653677612b0f21e5b36bcd4..1af1d9653e94b39623f8435957c6e7537c41c60a 100755 (executable)
@@ -975,10 +975,10 @@ cmd_merge () {
 
        if test -n "$arg_addmerge_message"
        then
-               git merge -Xsubtree="$arg_prefix" \
+               git merge --no-ff -Xsubtree="$arg_prefix" \
                        --message="$arg_addmerge_message" "$rev"
        else
-               git merge -Xsubtree="$arg_prefix" $rev
+               git merge --no-ff -Xsubtree="$arg_prefix" $rev
        fi
 }