]> git.ipfire.org Git - thirdparty/git.git/commitdiff
worktree: simplify incompatibility message for --orphan and commit-ish
authorRené Scharfe <l.s.r@web.de>
Wed, 6 Dec 2023 11:52:01 +0000 (12:52 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 8 Dec 2023 22:41:03 +0000 (07:41 +0900)
Use a single translatable string to report that the worktree add option
--orphan is incompatible with a commit-ish instead of having the
commit-ish in a separate translatable string.  This reduces the number
of strings to translate and gives translators the full context.

A similar message is used in builtin/describe.c, but with the plural of
commit-ish, and here we need the singular form.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/worktree.c

index 036ceaa98107af2d7902dab33f22679b496433ad..4ac16215416a004e9e0a5db321fa6d56c7f6c9ab 100644 (file)
@@ -815,8 +815,8 @@ static int add(int ac, const char **av, const char *prefix)
                die(_("options '%s' and '%s' cannot be used together"),
                    "--orphan", "--no-checkout");
        if (opts.orphan && ac == 2)
-               die(_("'%s' and '%s' cannot be used together"), "--orphan",
-                   _("<commit-ish>"));
+               die(_("option '%s' and commit-ish cannot be used together"),
+                   "--orphan");
        if (lock_reason && !keep_locked)
                die(_("the option '%s' requires '%s'"), "--reason", "--lock");
        if (lock_reason)