rerere: wrap paths in output in sq

It looks like most paths in the output in the git codebase are wrapped in single quotes. Standardize on that in rerere as well. Apart from being more consistent, this also makes some of the strings match strings that are already translated in other parts of the codebase, thus reducing the work for translators, when the strings are marked for translation in a subsequent commit. Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Thomas Gummerer committed Jul 14, 2018 at 22:44 UTC 28fc9abd3faaadfb882f7cd4586a9e27b067a284
2 files changed +14 -14
builtin/rerere.c
+1 -1
@@ -107,7 +107,7 @@ int cmd_rerere(int argc, const char **argv, const char *prefix)
107 const char *path = merge_rr.items[i].string;
108 const struct rerere_id *id = merge_rr.items[i].util;
109 if (diff_two(rerere_path(id, "preimage"), path, path, path))
110 - die("unable to generate diff for %s", rerere_path(id, NULL));
110 + die("unable to generate diff for '%s'", rerere_path(id, NULL));
111 }
112 } else
113 usage_with_options(rerere_usage, options);
rerere.c
+13 -13
@@ -484,12 +484,12 @@ static int handle_file(const char *path, unsigned char *sha1, const char *output
484 io.input = fopen(path, "r");
485 io.io.wrerror = 0;
486 if (!io.input)
487 - return error_errno("could not open %s", path);
487 + return error_errno("could not open '%s'", path);
488
489 if (output) {
490 io.io.output = fopen(output, "w");
491 if (!io.io.output) {
492 - error_errno("could not write %s", output);
492 + error_errno("could not write '%s'", output);
493 fclose(io.input);
494 return -1;
495 }
@@ -499,15 +499,15 @@ static int handle_file(const char *path, unsigned char *sha1, const char *output
499
500 fclose(io.input);
501 if (io.io.wrerror)
502 - error("there were errors while writing %s (%s)",
502 + error("there were errors while writing '%s' (%s)",
503 path, strerror(io.io.wrerror));
504 if (io.io.output && fclose(io.io.output))
505 - io.io.wrerror = error_errno("failed to flush %s", path);
505 + io.io.wrerror = error_errno("failed to flush '%s'", path);
506
507 if (hunk_no < 0) {
508 if (output)
509 unlink_or_warn(output);
510 - return error("could not parse conflict hunks in %s", path);
510 + return error("could not parse conflict hunks in '%s'", path);
511 }
512 if (io.io.wrerror)
513 return -1;
@@ -684,17 +684,17 @@ static int merge(const struct rerere_id *id, const char *path)
684 * Mark that "postimage" was used to help gc.
685 */
686 if (utime(rerere_path(id, "postimage"), NULL) < 0)
687 - warning_errno("failed utime() on %s",
687 + warning_errno("failed utime() on '%s'",
688 rerere_path(id, "postimage"));
689
690 /* Update "path" with the resolution */
691 f = fopen(path, "w");
692 if (!f)
693 - return error_errno("could not open %s", path);
693 + return error_errno("could not open '%s'", path);
694 if (fwrite(result.ptr, result.size, 1, f) != 1)
695 - error_errno("could not write %s", path);
695 + error_errno("could not write '%s'", path);
696 if (fclose(f))
697 - return error_errno("writing %s failed", path);
697 + return error_errno("writing '%s' failed", path);
698
699 out:
700 free(cur.ptr);
@@ -878,7 +878,7 @@ static int is_rerere_enabled(void)
878 return rr_cache_exists;
879
880 if (!rr_cache_exists && mkdir_in_gitdir(git_path_rr_cache()))
881 - die("could not create directory %s", git_path_rr_cache());
881 + die("could not create directory '%s'", git_path_rr_cache());
882 return 1;
883 }
884
@@ -1067,9 +1067,9 @@ static int rerere_forget_one_path(const char *path, struct string_list *rr)
1067 filename = rerere_path(id, "postimage");
1068 if (unlink(filename)) {
1069 if (errno == ENOENT)
1070 - error("no remembered resolution for %s", path);
1070 + error("no remembered resolution for '%s'", path);
1071 else
1072 - error_errno("cannot unlink %s", filename);
1072 + error_errno("cannot unlink '%s'", filename);
1073 goto fail_exit;
1074 }
1075
@@ -1088,7 +1088,7 @@ static int rerere_forget_one_path(const char *path, struct string_list *rr)
1088 item = string_list_insert(rr, path);
1089 free_rerere_id(item);
1090 item->util = id;
1091 - fprintf(stderr, "Forgot resolution for %s\n", path);
1091 + fprintf(stderr, "Forgot resolution for '%s'\n", path);
1092 return 0;
1093
1094 fail_exit: