rerere: unify error messages when read_cache fails

We have multiple different variants of the error message we show to the user if 'read_cache' fails. The "Could not read index" variant we are using in 'rerere.c' is currently not used anywhere in translated form. As a subsequent commit will mark all output that comes from 'rerere.c' for translation, make the life of the translators a little bit easier by using a string that is used elsewhere, and marked for translation there, and thus most likely already translated. "index file corrupt" seems to be the most common error message we show when 'read_cache' fails, so use that here as well. 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 e69db0b323ff35ffb15e96b0ab492c0f6268f43c
1 file changed +3 -3
rerere.c
+3 -3
@@ -568,7 +568,7 @@ static int find_conflict(struct string_list *conflict)
568 {
569 int i;
570 if (read_cache() < 0)
571 - return error("Could not read index");
571 + return error("index file corrupt");
572
573 for (i = 0; i < active_nr;) {
574 int conflict_type;
@@ -601,7 +601,7 @@ int rerere_remaining(struct string_list *merge_rr)
601 if (setup_rerere(merge_rr, RERERE_READONLY))
602 return 0;
603 if (read_cache() < 0)
604 - return error("Could not read index");
604 + return error("index file corrupt");
605
606 for (i = 0; i < active_nr;) {
607 int conflict_type;
@@ -1103,7 +1103,7 @@ int rerere_forget(struct pathspec *pathspec)
1103 struct string_list merge_rr = STRING_LIST_INIT_DUP;
1104
1105 if (read_cache() < 0)
1106 - return error("Could not read index");
1106 + return error("index file corrupt");
1107
1108 fd = setup_rerere(&merge_rr, RERERE_NOAUTOUPDATE);
1109 if (fd < 0)