diff options
author | Oswald Buddenhagen <oswald.buddenhagen@gmx.de> | 2023-08-07 20:09:35 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-08-07 23:21:00 +0300 |
commit | ff29a61cbbc83f0948606df37dbc734436b62c17 (patch) | |
tree | 7f455cdf5937f64163fb20c705bff98871f4ea95 /advice.c | |
parent | ac83bc5054c2ac489166072334b4147ce6d0fccb (diff) |
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 <oswald.buddenhagen@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'advice.c')
-rw-r--r-- | advice.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -191,9 +191,10 @@ int error_resolve_conflict(const char *me) error(_("Pulling is not possible because you have unmerged files.")); else if (!strcmp(me, "revert")) error(_("Reverting is not possible because you have unmerged files.")); + else if (!strcmp(me, "rebase")) + error(_("Rebasing is not possible because you have unmerged files.")); else - error(_("It is not possible to %s because you have unmerged files."), - me); + BUG("Unhandled conflict reason '%s'", me); if (advice_enabled(ADVICE_RESOLVE_CONFLICT)) /* |