sequencer: quote filenames in error messages
This makes the code consistent by fixing quite a couple of error messages. Suggested by Jakub Narębski. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Oct 21, 2016 at 14:26 UTC
f7ed1953d88e3eaffbbd52e47faa73ae8640ecd7
1 file changed
+11
-11
sequencer.c
+11
-11
@@ -252,7 +252,7 @@ static int write_message(const void *buf, size_t len, const char *filename,
252
}
253
if (commit_lock_file(&msg_file) < 0) {
254
rollback_lock_file(&msg_file);
255
- return error(_("Error wrapping up %s."), filename);
255
+ return error(_("Error wrapping up '%s'."), filename);
256
}
257
258
return 0;
@@ -954,16 +954,16 @@ static int read_populate_todo(struct todo_list *todo_list,
954
strbuf_reset(&todo_list->buf);
955
fd = open(todo_file, O_RDONLY);
956
if (fd < 0)
957
- return error_errno(_("Could not open %s"), todo_file);
957
+ return error_errno(_("Could not open '%s'"), todo_file);
958
if (strbuf_read(&todo_list->buf, fd, 0) < 0) {
959
close(fd);
960
- return error(_("Could not read %s."), todo_file);
960
+ return error(_("Could not read '%s'."), todo_file);
961
}
962
close(fd);
963
964
res = parse_insn_buffer(todo_list->buf.buf, todo_list);
965
if (res)
966
- return error(_("Unusable instruction sheet: %s"), todo_file);
966
+ return error(_("Unusable instruction sheet: '%s'"), todo_file);
967
968
if (!is_rebase_i(opts)) {
969
enum todo_command valid =
@@ -1054,7 +1054,7 @@ static int read_populate_opts(struct replay_opts *opts)
1054
* are pretty certain that it is syntactically correct.
1055
*/
1056
if (git_config_from_file(populate_opts_cb, git_path_opts_file(), opts) < 0)
1057
- return error(_("Malformed options sheet: %s"),
1057
+ return error(_("Malformed options sheet: '%s'"),
1058
git_path_opts_file());
1059
return 0;
1060
}
@@ -1097,7 +1097,7 @@ static int create_seq_dir(void)
1097
return -1;
1098
}
1099
else if (mkdir(git_path_seq_dir(), 0777) < 0)
1100
- return error_errno(_("Could not create sequencer directory %s"),
1100
+ return error_errno(_("Could not create sequencer directory '%s'"),
1101
git_path_seq_dir());
1102
return 0;
1103
}
@@ -1116,12 +1116,12 @@ static int save_head(const char *head)
1116
strbuf_addf(&buf, "%s\n", head);
1117
if (write_in_full(fd, buf.buf, buf.len) < 0) {
1118
rollback_lock_file(&head_lock);
1119
- return error_errno(_("Could not write to %s"),
1119
+ return error_errno(_("Could not write to '%s'"),
1120
git_path_head_file());
1121
}
1122
if (commit_lock_file(&head_lock) < 0) {
1123
rollback_lock_file(&head_lock);
1124
- return error(_("Error wrapping up %s."), git_path_head_file());
1124
+ return error(_("Error wrapping up '%s'."), git_path_head_file());
1125
}
1126
return 0;
1127
}
@@ -1166,9 +1166,9 @@ int sequencer_rollback(struct replay_opts *opts)
1166
return rollback_single_pick();
1167
}
1168
if (!f)
1169
- return error_errno(_("cannot open %s"), git_path_head_file());
1169
+ return error_errno(_("cannot open '%s'"), git_path_head_file());
1170
if (strbuf_getline_lf(&buf, f)) {
1171
- error(_("cannot read %s: %s"), git_path_head_file(),
1171
+ error(_("cannot read '%s': %s"), git_path_head_file(),
1172
ferror(f) ? strerror(errno) : _("unexpected end of file"));
1173
fclose(f);
1174
goto fail;
@@ -1207,7 +1207,7 @@ static int save_todo(struct todo_list *todo_list, struct replay_opts *opts)
1207
todo_list->buf.len - offset) < 0)
1208
return error_errno(_("Could not write to '%s'"), todo_path);
1209
if (commit_lock_file(&todo_lock) < 0)
1210
- return error(_("Error wrapping up %s."), todo_path);
1210
+ return error(_("Error wrapping up '%s'."), todo_path);
1211
return 0;
1212
}
1213