merge-ort: do leave trace2 region even if checkout fails

In 557ac0350d (merge-ort: begin performance work; instrument with
trace2_region_* calls, 2021-01-23), we added Trace2 instrumentation, but
in the error path that returns early, we forgot to tell Trace2 that
we're leaving the region. Let's fix that.

Pointed-out-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Johannes Schindelin 2022-07-29 17:12:07 +00:00 коммит произвёл Junio C Hamano
Родитель fef2b6dace
Коммит 1250dff32b
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -4226,6 +4226,7 @@ void merge_switch_to_result(struct merge_options *opt,
/* failure to function */
result->clean = -1;
merge_finalize(opt, result);
trace2_region_leave("merge", "checkout", opt->repo);
return;
}
trace2_region_leave("merge", "checkout", opt->repo);
@ -4237,6 +4238,8 @@ void merge_switch_to_result(struct merge_options *opt,
opt->priv = NULL;
result->clean = -1;
merge_finalize(opt, result);
trace2_region_leave("merge", "record_conflicted",
opt->repo);
return;
}
opt->priv = NULL;