]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/am.c
am -3: use merge_recursive() directly again
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Tue, 26 Jul 2016 16:06:30 +0000 (18:06 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 26 Jul 2016 18:13:44 +0000 (11:13 -0700)
commit3f338f43b0eb8081660bbf694074a368cf07355e
treec02a0a46f5c55583be4d2bf4946e527a2016c1c5
parent6003303a1e5086a9f28f18469a8a72ad22f75c86
am -3: use merge_recursive() directly again

Last October, we had to change this code to run `git merge-recursive`
in a child process: git-am wants to print some helpful advice when the
merge failed, but the code in question was not prepared to return, it
die()d instead.

We are finally at a point when the code *is* prepared to return errors,
and can avoid the child process again.

This reverts commit c63d4b2 (am -3: do not let failed merge from
completing the error codepath, 2015-10-09), with the necessary changes
to adjust for the fact that Git's source code changed in the meantime
(such as: using OIDs instead of hashes in the recursive merge, and a
removed gender bias).

Note: the code now calls merge_recursive_generic() again. Unlike
merge_trees() and merge_recursive(), this function returns 0 upon success,
as most of Git's functions. Therefore, the error value -1 naturally is
handled correctly, and we do not have to take care of it specifically.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/am.c