Re: [PATCH v2 04/20] merge-recursive: exit early if index != head

2019-07-29 Thread Junio C Hamano
Elijah Newren writes: > On Fri, Jul 26, 2019 at 12:32 PM Junio C Hamano wrote: >> >> Elijah Newren writes: >> >> > Make sure we do the index == head check at the beginning of the merge, >> > and error out immediately if it fails. While we're at it, fix a small >> > leak in the show-the-error c

Re: [PATCH v2 04/20] merge-recursive: exit early if index != head

2019-07-26 Thread Elijah Newren
On Fri, Jul 26, 2019 at 12:32 PM Junio C Hamano wrote: > > Elijah Newren writes: > > > Make sure we do the index == head check at the beginning of the merge, > > and error out immediately if it fails. While we're at it, fix a small > > leak in the show-the-error codepath. > > As the call to repo

Re: [PATCH v2 04/20] merge-recursive: exit early if index != head

2019-07-26 Thread Junio C Hamano
Elijah Newren writes: > Make sure we do the index == head check at the beginning of the merge, > and error out immediately if it fails. While we're at it, fix a small > leak in the show-the-error codepath. As the call to repo_index_has_changes() is moved to the very beginning of merge_recursive

[PATCH v2 04/20] merge-recursive: exit early if index != head

2019-07-26 Thread Elijah Newren
We had a rule to enforce that the index matches head, but it was found at the beginning of merge_trees() and would only trigger when opt->call_depth was 0. Since merge_recursive() doesn't call merge_trees() until after returning from recursing, this meant that the check wasn't triggered by merge_r