Merge branch 'tl/push-branches-is-an-alias-for-all'
"git push --all" gained an alias "git push --branches". * tl/push-branches-is-an-alias-for-all: t5583: fix shebang line push: introduce '--branches' option
This commit is contained in:
@ -595,11 +595,12 @@ int cmd_push(int argc, const char **argv, const char *prefix)
|
||||
struct option options[] = {
|
||||
OPT__VERBOSITY(&verbosity),
|
||||
OPT_STRING( 0 , "repo", &repo, N_("repository"), N_("repository")),
|
||||
OPT_BIT( 0 , "all", &flags, N_("push all refs"), TRANSPORT_PUSH_ALL),
|
||||
OPT_BIT( 0 , "all", &flags, N_("push all branches"), TRANSPORT_PUSH_ALL),
|
||||
OPT_ALIAS( 0 , "branches", "all"),
|
||||
OPT_BIT( 0 , "mirror", &flags, N_("mirror all refs"),
|
||||
(TRANSPORT_PUSH_MIRROR|TRANSPORT_PUSH_FORCE)),
|
||||
OPT_BOOL('d', "delete", &deleterefs, N_("delete refs")),
|
||||
OPT_BOOL( 0 , "tags", &tags, N_("push tags (can't be used with --all or --mirror)")),
|
||||
OPT_BOOL( 0 , "tags", &tags, N_("push tags (can't be used with --all or --branches or --mirror)")),
|
||||
OPT_BIT('n' , "dry-run", &flags, N_("dry run"), TRANSPORT_PUSH_DRY_RUN),
|
||||
OPT_BIT( 0, "porcelain", &flags, N_("machine-readable output"), TRANSPORT_PUSH_PORCELAIN),
|
||||
OPT_BIT('f', "force", &flags, N_("force updates"), TRANSPORT_PUSH_FORCE),
|
||||
@ -642,7 +643,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
|
||||
set_push_cert_flags(&flags, push_cert);
|
||||
|
||||
if (deleterefs && (tags || (flags & (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR))))
|
||||
die(_("options '%s' and '%s' cannot be used together"), "--delete", "--all/--mirror/--tags");
|
||||
die(_("options '%s' and '%s' cannot be used together"), "--delete", "--all/--branches/--mirror/--tags");
|
||||
if (deleterefs && argc < 2)
|
||||
die(_("--delete doesn't make sense without any refs"));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user