cat-file: quote-format name in error when using -z
Since it's supported to have NUL-delimited input, introduced in
db9d67f2 (builtin/cat-file.c: support NUL-delimited input with -z
,
2022-07-22), it's possible to pass paths that contain newlines. This
works great when the object is found, but when it's not, the input path
is returned in the error message. Because this can contain newlines, the
error message might get spread over multiple lines, making it harder to
machine-parse this error message.
With this change, the input is quote-formatted in the error message, if needed. This ensures the error message is always on a single line and makes parsing the error more straightforward.
Issue: #141 (closed)
Edited by Toon Claes