Browse Source

Merge branch 'mz/push-verbose'

* mz/push-verbose:
  Make push more verbose about illegal combination of options
maint
Junio C Hamano 17 years ago
parent
commit
1071dd6112
  1. 13
      builtin-push.c

13
builtin-push.c

@ -59,8 +59,17 @@ static int do_push(const char *repo, int flags) @@ -59,8 +59,17 @@ static int do_push(const char *repo, int flags)
if (remote->mirror)
flags |= (TRANSPORT_PUSH_MIRROR|TRANSPORT_PUSH_FORCE);

if ((flags & (TRANSPORT_PUSH_ALL|TRANSPORT_PUSH_MIRROR)) && refspec)
return -1;
if ((flags & TRANSPORT_PUSH_ALL) && refspec) {
if (!strcmp(*refspec, "refs/tags/*"))
return error("--all and --tags are incompatible");
return error("--all can't be combined with refspecs");
}

if ((flags & TRANSPORT_PUSH_MIRROR) && refspec) {
if (!strcmp(*refspec, "refs/tags/*"))
return error("--mirror and --tags are incompatible");
return error("--mirror can't be combined with refspecs");
}

if ((flags & (TRANSPORT_PUSH_ALL|TRANSPORT_PUSH_MIRROR)) ==
(TRANSPORT_PUSH_ALL|TRANSPORT_PUSH_MIRROR)) {

Loading…
Cancel
Save