Merge branch 'jc/show-branch-g-current' into maint

The "--current" option of "git show-branch" should have been made
incompatible with the "--reflog" mode, but this was not enforced,
which has been corrected.
source: <xmqqh76mf7s4.fsf_-_@gitster.g>

* jc/show-branch-g-current:
  show-branch: -g and --current are incompatible
This commit is contained in:
Junio C Hamano
2022-06-08 14:27:51 -07:00
2 changed files with 18 additions and 0 deletions

View File

@ -712,6 +712,10 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
"--all/--remotes/--independent/--merge-base");
}
if (with_current_branch && reflog)
die(_("options '%s' and '%s' cannot be used together"),
"--reflog", "--current");
/* If nothing is specified, show all branches by default */
if (ac <= topics && all_heads + all_remotes == 0)
all_heads = 1;