[PATCH 1/4] branch: '--edit-description' is incompatible with other options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



'--edit-description' is incompatible with 'git branch's other options,
but the check for conflicting options doesn't look for this option.
As a result 'git branch' doesn't error out showing usage when
'--edit-description' is used in combination with other options, but
e.g. 'git branch --list --edit-description' lists all branches and
doesn't edit any branch descriptions, while 'git branch
--edit-description --list' edits the current branch's description but
doesn't list the branches.

Look for '--edit-description', too, when looking for conflicting
options.

Signed-off-by: SZEDER Gábor <szeder.dev@xxxxxxxxx>
---
 builtin/branch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/branch.c b/builtin/branch.c
index 8dcc2ed05..32531aa44 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -662,7 +662,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
 		list = 1;
 
 	if (!!delete + !!rename + !!copy + !!new_upstream +
-	    list + unset_upstream > 1)
+	    list + unset_upstream + edit_description > 1)
 		usage_with_options(builtin_branch_usage, options);
 
 	if (filter.abbrev == -1)
-- 
2.16.0.rc0.67.g3a46dbca7




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux