merge: handle --ff/--no-ff/--ff-only as a tri-state option
commita54841e96b78203598dea6b31b9618f40f107e7b
authorMiklos Vajna <vmiklos@suse.cz>
Tue, 2 Jul 2013 14:47:57 +0000 (2 16:47 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 2 Jul 2013 20:08:42 +0000 (2 13:08 -0700)
tree76465742ce499ceed97377fe792e881e0a5da1bb
parent7a3187eb788854ed3a20fee30b27e68430f753b7
merge: handle --ff/--no-ff/--ff-only as a tri-state option

These three options mean "favor fast-forwarding when possible,
without creating an unnecessary merge", "never fast-forward and
always create a merge commit even when the commit being merged is a
strict descendant", and "we do not want to create any merge commit;
update only when the merged commit is a strict descendant".

They are "pick one out of these three possibilities" options, and
correspond to "merge.ff" configuration that is tri-state (yes, no
and only).

However, the implementation did not follow the usual convention for
the command line options (later one wins, and command line overrides
what is in the configuration).

Fix this by consolidating two variables (fast_forward_only and
allow_fast_forward) used in the implementation into one enum that
can take one of the three possible values.

Signed-off-by: Miklos Vajna <vmiklos@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/merge.c
t/t7600-merge.sh