Skip to content

Commit 0a288d1

Browse files
rudisgitster
authored andcommitted
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 <[email protected]> [jc: adjusted tests I noticed were broken by the change] Signed-off-by: Junio C Hamano <[email protected]>
1 parent cb5918a commit 0a288d1

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

t/t3600-rm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ test_expect_success 'checking out a commit after submodule removal needs manual
688688
git submodule update &&
689689
git checkout -q HEAD^ &&
690690
git checkout -q master 2>actual &&
691-
test_i18ngrep "^warning: unable to rmdir submod:" actual &&
691+
test_i18ngrep "^warning: unable to rmdir '\''submod'\'':" actual &&
692692
git status -s submod >actual &&
693693
echo "?? submod/" >expected &&
694694
test_cmp expected actual &&

t/t7001-mv.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ test_expect_success 'checking out a commit before submodule moved needs manual u
452452
git mv sub sub2 &&
453453
git commit -m "moved sub to sub2" &&
454454
git checkout -q HEAD^ 2>actual &&
455-
test_i18ngrep "^warning: unable to rmdir sub2:" actual &&
455+
test_i18ngrep "^warning: unable to rmdir '\''sub2'\'':" actual &&
456456
git status -s sub2 >actual &&
457457
echo "?? sub2/" >expected &&
458458
test_cmp expected actual &&

wrapper.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ static int warn_if_unremovable(const char *op, const char *file, int rc)
569569
if (!rc || errno == ENOENT)
570570
return 0;
571571
err = errno;
572-
warning_errno("unable to %s %s", op, file);
572+
warning_errno("unable to %s '%s'", op, file);
573573
errno = err;
574574
return rc;
575575
}
@@ -583,7 +583,7 @@ int unlink_or_msg(const char *file, struct strbuf *err)
583583
if (!rc || errno == ENOENT)
584584
return 0;
585585

586-
strbuf_addf(err, "unable to unlink %s: %s",
586+
strbuf_addf(err, "unable to unlink '%s': %s",
587587
file, strerror(errno));
588588
return -1;
589589
}
@@ -653,9 +653,9 @@ void write_file_buf(const char *path, const char *buf, size_t len)
653653
{
654654
int fd = xopen(path, O_WRONLY | O_CREAT | O_TRUNC, 0666);
655655
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);
657657
if (close(fd))
658-
die_errno(_("could not close %s"), path);
658+
die_errno(_("could not close '%s'"), path);
659659
}
660660

661661
void write_file(const char *path, const char *fmt, ...)

0 commit comments

Comments
 (0)