summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 053fd0c)
raw | patch | inline | side by side (parent: 053fd0c)
author | Marek Zawirski <marek.zawirski@gmail.com> | |
Sat, 16 Aug 2008 17:58:32 +0000 (19:58 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 17 Aug 2008 07:24:21 +0000 (00:24 -0700) |
It may be unclear that --all, --mirror, --tags and/or explicit refspecs
are illegal combinations for git push.
Git was silently failing in these cases, while we can complaint more
properly about it.
Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
are illegal combinations for git push.
Git was silently failing in these cases, while we can complaint more
properly about it.
Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-push.c | patch | blob | history |
diff --git a/builtin-push.c b/builtin-push.c
index c1ed68d938f67343c6938cfef54d5ff69a522a63..cc6666f75e7db8a546d4a1589335589190e414fe 100644 (file)
--- a/builtin-push.c
+++ b/builtin-push.c
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)) {