Skip to content

Commit

Permalink
subtree: force merge commit
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Johannes Altmanninger <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
koutcher authored and gitster committed Feb 1, 2022
1 parent 4c53a8c commit 9158a35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contrib/subtree/git-subtree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 9158a35

Please sign in to comment.