merge-ours: do not use cmd_*() as a subroutine
commita92b1095d190ea348d365baeb9ff5c5023d0efd2
authorJunio C Hamano <gitster@pobox.com>
Tue, 10 Oct 2017 03:04:48 +0000 (10 12:04 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 11 Oct 2017 06:04:38 +0000 (11 15:04 +0900)
treefec3e0fe65eb98e23326f4318e33f6952253991b
parentbe26d2b29b6a58fc53ed9d38c3f36b195f8a7cc9
merge-ours: do not use cmd_*() as a subroutine

The call to cmd_diff_index() "git merge-ours" makes has been working
by accident that the function did not call exit(3), and the caller
exited almost immediately after making a call, but it sets a bad
precedent for people to cut and paste.

For finding out if the index exactly matches the HEAD (or a given
tree-ish), there is index_differs_from() which is exactly written
for that purpose.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/merge-ours.c