Skip to content

Commit 408c5c5

Browse files
jnavilagitster
authored andcommitted
i18n: tag.c factorize i18n strings
Signed-off-by: Jean-Noël Avila <[email protected]> Reviewed-by: Johannes Sixt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c490437 commit 408c5c5

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

builtin/tag.c

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
483483
OPT_END()
484484
};
485485
int ret = 0;
486+
const char *only_in_list = NULL;
486487

487488
setup_ref_filter_porcelain_msg();
488489

@@ -542,15 +543,19 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
542543
goto cleanup;
543544
}
544545
if (filter.lines != -1)
545-
die(_("-n option is only allowed in list mode"));
546-
if (filter.with_commit)
547-
die(_("--contains option is only allowed in list mode"));
548-
if (filter.no_commit)
549-
die(_("--no-contains option is only allowed in list mode"));
550-
if (filter.points_at.nr)
551-
die(_("--points-at option is only allowed in list mode"));
552-
if (filter.reachable_from || filter.unreachable_from)
553-
die(_("--merged and --no-merged options are only allowed in list mode"));
546+
only_in_list = "-n";
547+
else if (filter.with_commit)
548+
only_in_list = "--contains";
549+
else if (filter.no_commit)
550+
only_in_list = "--no-contains";
551+
else if (filter.points_at.nr)
552+
only_in_list = "--points-at";
553+
else if (filter.reachable_from)
554+
only_in_list = "--merged";
555+
else if (filter.unreachable_from)
556+
only_in_list = "--no-merged";
557+
if (only_in_list)
558+
die(_("the '%s' option is only allowed in list mode"), only_in_list);
554559
if (cmdmode == 'd') {
555560
ret = delete_tags(argv);
556561
goto cleanup;

0 commit comments

Comments
 (0)