aboutsummaryrefslogtreecommitdiffstats
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2024-06-19 03:00:14 +0000
committerJunio C Hamano <gitster@pobox.com>2024-06-20 10:35:24 -0700
commit0b4f726cde2743d59742deeb827783ae6ffed570 (patch)
treefdfb2805aad3102d01ae98e6438caeb7476b7fb5 /git-send-email.perl
parentmerge-ort: extract handling of priv member into reusable function (diff)
downloadgit-0b4f726cde2743d59742deeb827783ae6ffed570.tar.gz
git-0b4f726cde2743d59742deeb827783ae6ffed570.zip
merge-ort: maintain expected invariant for priv member
The calling convention for the merge machinery is One call to init_merge_options() One or more calls to merge_incore_[non]recursive() One call to merge_finalize() (possibly indirectly via merge_switch_to_result()) Both merge_switch_to_result() and merge_finalize() expect opt->priv == NULL && result->priv != NULL which is supposed to be set up by our move_opt_priv_to_result_priv() function. However, two codepaths dealing with error cases did not execute this necessary logic, which could result in assertion failures (or, if assertions were compiled out, could result in segfaults). Fix the oversight and add a test that would have caught one of these problems. While at it, also tighten an existing test for a non-recursive merge to verify that it fails with appropriate status. Most merge tests in the testsuite check either for success or conflicts; those testing for neither are rare and it is good to ensure they support the invariant assumed by builtin/merge.c in this comment: /* * The backend exits with 1 when conflicts are * left to be resolved, with 2 when it does not * handle the given merge at all. */ So, explicitly check for the exit status of 2 in these cases. Reported-by: Matt Cree <matt.cree@gearset.com> Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-send-email.perl')
0 files changed, 0 insertions, 0 deletions