Commit bea5fd9f by Patrick Steinhardt

diff_print: do not call abort(3P)

Calling abort(3P) in a library is rather rude and shouldn't happen, as
we effectively prohibit any corrective actions made by the application
linking to it. We thus shouldn't call it at all, but instead use our new
`GIT_ASSERT` macros.

Remove the call to abort(3P) in case a diff delta has an unexpected type
to fix this.
parent 0cf1f444
......@@ -351,12 +351,11 @@ static int diff_delta_format_similarity_header(
goto done;
}
GIT_ASSERT(delta->status == GIT_DELTA_RENAMED || delta->status == GIT_DELTA_COPIED);
if (delta->status == GIT_DELTA_RENAMED)
type = "rename";
else if (delta->status == GIT_DELTA_COPIED)
type = "copy";
else
abort();
type = "copy";
if ((error = git_buf_puts(&old_path, delta->old_file.path)) < 0 ||
(error = git_buf_puts(&new_path, delta->new_file.path)) < 0 ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment