Merge branch 'jc/abort-ll-merge-with-a-signal'

When the external merge driver is killed by a signal, its output
should not be trusted as a resolution with conflicts that is
proposed by the driver, but the code did.

* jc/abort-ll-merge-with-a-signal:
  t6406: skip "external merge driver getting killed by a signal" test on Windows
  ll-merge: killing the external merge driver aborts the merge
This commit is contained in:
Junio C Hamano
2023-06-29 16:43:21 -07:00
3 changed files with 35 additions and 2 deletions

View File

@ -243,7 +243,14 @@ static enum ll_merge_result ll_ext_merge(const struct ll_merge_driver *fn,
unlink_or_warn(temp[i]);
strbuf_release(&cmd);
strbuf_release(&path_sq);
ret = (status > 0) ? LL_MERGE_CONFLICT : status;
if (!status)
ret = LL_MERGE_OK;
else if (status <= 128)
ret = LL_MERGE_CONFLICT;
else
/* died due to a signal: WTERMSIG(status) + 128 */
ret = LL_MERGE_ERROR;
return ret;
}