Skip to content

Commit 255f04d

Browse files
larsxschneidergitster
authored andcommitted
convert: quote filter names in error messages
Git filter driver commands with spaces (e.g. `filter.sh foo`) are hard to read in error messages. Quote them to improve the readability. Signed-off-by: Lars Schneider <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 35f6318 commit 255f04d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

convert.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ static int filter_buffer_or_fd(int in, int out, void *data)
412412
child_process.out = out;
413413

414414
if (start_command(&child_process))
415-
return error("cannot fork to run external filter %s", params->cmd);
415+
return error("cannot fork to run external filter '%s'", params->cmd);
416416

417417
sigchain_push(SIGPIPE, SIG_IGN);
418418

@@ -430,13 +430,13 @@ static int filter_buffer_or_fd(int in, int out, void *data)
430430
if (close(child_process.in))
431431
write_err = 1;
432432
if (write_err)
433-
error("cannot feed the input to external filter %s", params->cmd);
433+
error("cannot feed the input to external filter '%s'", params->cmd);
434434

435435
sigchain_pop(SIGPIPE);
436436

437437
status = finish_command(&child_process);
438438
if (status)
439-
error("external filter %s failed %d", params->cmd, status);
439+
error("external filter '%s' failed %d", params->cmd, status);
440440

441441
strbuf_release(&cmd);
442442
return (write_err || status);
@@ -477,15 +477,15 @@ static int apply_filter(const char *path, const char *src, size_t len, int fd,
477477
return 0; /* error was already reported */
478478

479479
if (strbuf_read(&nbuf, async.out, len) < 0) {
480-
error("read from external filter %s failed", cmd);
480+
error("read from external filter '%s' failed", cmd);
481481
ret = 0;
482482
}
483483
if (close(async.out)) {
484-
error("read from external filter %s failed", cmd);
484+
error("read from external filter '%s' failed", cmd);
485485
ret = 0;
486486
}
487487
if (finish_async(&async)) {
488-
error("external filter %s failed", cmd);
488+
error("external filter '%s' failed", cmd);
489489
ret = 0;
490490
}
491491

0 commit comments

Comments
 (0)