Skip to content

Commit e69db0b

Browse files
tgummerergitster
authored andcommitted
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>
1 parent e333175 commit e69db0b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rerere.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ static int find_conflict(struct string_list *conflict)
568568
{
569569
int i;
570570
if (read_cache() < 0)
571-
return error("Could not read index");
571+
return error("index file corrupt");
572572

573573
for (i = 0; i < active_nr;) {
574574
int conflict_type;
@@ -601,7 +601,7 @@ int rerere_remaining(struct string_list *merge_rr)
601601
if (setup_rerere(merge_rr, RERERE_READONLY))
602602
return 0;
603603
if (read_cache() < 0)
604-
return error("Could not read index");
604+
return error("index file corrupt");
605605

606606
for (i = 0; i < active_nr;) {
607607
int conflict_type;
@@ -1103,7 +1103,7 @@ int rerere_forget(struct pathspec *pathspec)
11031103
struct string_list merge_rr = STRING_LIST_INIT_DUP;
11041104

11051105
if (read_cache() < 0)
1106-
return error("Could not read index");
1106+
return error("index file corrupt");
11071107

11081108
fd = setup_rerere(&merge_rr, RERERE_NOAUTOUPDATE);
11091109
if (fd < 0)

0 commit comments

Comments
 (0)