Skip to content

Commit ff29a61

Browse files
ossilatorgitster
authored andcommitted
advice: handle "rebase" in error_resolve_conflict()
This makes sure that we get a properly translated message rather than inserting the command (which we failed to translate) into a generic fallback message. The function is called indirectly via die_resolve_conflict() with fixed strings, and directly with the string obtained via action_name(), which in turn returns a string from a fixed set. Hence we know that the now covered set of strings is exhausitive, and will therefore BUG() out when encountering an unexpected string. We also know that all covered strings are actually used. Arguably, the above suggests that it would be cleaner to pass the command as an enum in the first place, but that's left for another time. Signed-off-by: Oswald Buddenhagen <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ac83bc5 commit ff29a61

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

advice.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,10 @@ int error_resolve_conflict(const char *me)
191191
error(_("Pulling is not possible because you have unmerged files."));
192192
else if (!strcmp(me, "revert"))
193193
error(_("Reverting is not possible because you have unmerged files."));
194+
else if (!strcmp(me, "rebase"))
195+
error(_("Rebasing is not possible because you have unmerged files."));
194196
else
195-
error(_("It is not possible to %s because you have unmerged files."),
196-
me);
197+
BUG("Unhandled conflict reason '%s'", me);
197198

198199
if (advice_enabled(ADVICE_RESOLVE_CONFLICT))
199200
/*

0 commit comments

Comments
 (0)