]> git.ipfire.org Git - thirdparty/git.git/commitdiff
branch: don't mix --edit-description
authorDenton Liu <liu.denton@gmail.com>
Mon, 15 Jun 2020 11:53:20 +0000 (07:53 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 17 Jun 2020 18:12:34 +0000 (11:12 -0700)
`git branch` accepts `--edit-description` in conjunction with other
arguments. However, `--edit-description` is its own mode, similar to
`--set-upstream-to`, which is also made mutually exclusive with other
modes. Prevent `--edit-description` from being mixed with other modes.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/branch.c

index d8297f80ffc730442d9a590650fe4644b2351d04..1263eb279732e8900a091ce447a75b9ce3a8b4d4 100644 (file)
@@ -695,7 +695,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
                list = 1;
 
        if (!!delete + !!rename + !!copy + !!new_upstream + !!show_current +
-           list + unset_upstream > 1)
+           list + edit_description + unset_upstream > 1)
                usage_with_options(builtin_branch_usage, options);
 
        if (filter.abbrev == -1)