diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-08-20 23:41:51 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-08-20 23:41:51 -0700 |
commit | 1071dd61123aca744caec08413da2985dbdeec93 (patch) | |
tree | c0decf3af23800bf4a637b524c75efa7522361ff | |
parent | 0a8eb7bae5101a3c1f550d67f1d4c0879dd417da (diff) | |
parent | b259f09b181c6650253f2ab60f5375d3ff8e3872 (diff) | |
download | git-1071dd61123aca744caec08413da2985dbdeec93.tar.gz |
Merge branch 'mz/push-verbose'
* mz/push-verbose:
Make push more verbose about illegal combination of options
-rw-r--r-- | builtin-push.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/builtin-push.c b/builtin-push.c index c1ed68d938..cc6666f75e 100644 --- a/builtin-push.c +++ b/builtin-push.c @@ -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)) { |