]> git.ipfire.org Git - thirdparty/git.git/commit - t/t6028-merge-up-to-date.sh
git-merge: do up-to-date check also for all strategies
authorJunio C Hamano <gitster@pobox.com>
Thu, 16 Aug 2007 06:19:55 +0000 (23:19 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 Aug 2007 06:48:28 +0000 (23:48 -0700)
commita005085240ef77ac0dde8eb08e27c6ef868d4bab
tree6f1a05ea146ed26c6229b972cf13e1d9230e37ec
parent9277d60233a1829742aa2d9d20ddbfc3b2b7acde
git-merge: do up-to-date check also for all strategies

This clarifies the logic to omit fast-forward check and omit
trivial merge before running the specified strategy.

The "index_merge" variable started out as a flag to say "do not
do anything clever", but when recursive was changed to skip the
trivial merge, the semantics were changed and the variable alone
does not make sense anymore.

This splits the variable into two, allow_fast_forward (which is
almost always true, and avoids making a merge commit when the
other commit is a descendant of our branch, but is set to false
for ours and subtree) and allow_trivial_merge (which is false
for ours, recursive and subtree).

Unlike the earlier implementation, the "ours" strategy allows an
up-to-date condition.  When we are up-to-date, the result will
be our commit, and by definition, we will have our tree as the
result.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-merge.sh
t/t6028-merge-up-to-date.sh [new file with mode: 0755]