wrapper.c: consistently quote filenames in error messages

All other error messages in the file use quotes around the file name. This change removes two translations as "could not write to '%s'" and "could not close '%s'" are already translated and these two are the only occurrences without quotes. Signed-off-by: Simon Ruderich <simon@ruderich.org> [jc: adjusted tests I noticed were broken by the change] Signed-off-by: Junio C Hamano <gitster@pobox.com>

Simon Ruderich committed Nov 1, 2017 at 15:44 UTC 0a288d1ee9a259d9faf238c5e4f5aedf5090d599
3 files changed +6 -6
t/t3600-rm.sh
+1 -1
@@ -688,7 +688,7 @@ test_expect_success 'checking out a commit after submodule removal needs manual
688 git submodule update &&
689 git checkout -q HEAD^ &&
690 git checkout -q master 2>actual &&
691 - test_i18ngrep "^warning: unable to rmdir submod:" actual &&
691 + test_i18ngrep "^warning: unable to rmdir '\''submod'\'':" actual &&
692 git status -s submod >actual &&
693 echo "?? submod/" >expected &&
694 test_cmp expected actual &&
t/t7001-mv.sh
+1 -1
@@ -452,7 +452,7 @@ test_expect_success 'checking out a commit before submodule moved needs manual u
452 git mv sub sub2 &&
453 git commit -m "moved sub to sub2" &&
454 git checkout -q HEAD^ 2>actual &&
455 - test_i18ngrep "^warning: unable to rmdir sub2:" actual &&
455 + test_i18ngrep "^warning: unable to rmdir '\''sub2'\'':" actual &&
456 git status -s sub2 >actual &&
457 echo "?? sub2/" >expected &&
458 test_cmp expected actual &&
wrapper.c
+4 -4
@@ -569,7 +569,7 @@ static int warn_if_unremovable(const char *op, const char *file, int rc)
569 if (!rc || errno == ENOENT)
570 return 0;
571 err = errno;
572 - warning_errno("unable to %s %s", op, file);
572 + warning_errno("unable to %s '%s'", op, file);
573 errno = err;
574 return rc;
575 }
@@ -583,7 +583,7 @@ int unlink_or_msg(const char *file, struct strbuf *err)
583 if (!rc || errno == ENOENT)
584 return 0;
585
586 - strbuf_addf(err, "unable to unlink %s: %s",
586 + strbuf_addf(err, "unable to unlink '%s': %s",
587 file, strerror(errno));
588 return -1;
589 }
@@ -653,9 +653,9 @@ void write_file_buf(const char *path, const char *buf, size_t len)
653 {
654 int fd = xopen(path, O_WRONLY | O_CREAT | O_TRUNC, 0666);
655 if (write_in_full(fd, buf, len) < 0)
656 - die_errno(_("could not write to %s"), path);
656 + die_errno(_("could not write to '%s'"), path);
657 if (close(fd))
658 - die_errno(_("could not close %s"), path);
658 + die_errno(_("could not close '%s'"), path);
659 }
660
661 void write_file(const char *path, const char *fmt, ...)