mirror of
https://github.com/git/git
synced 2024-08-24 18:26:02 +00:00
Make push more verbose about illegal combination of options
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>
This commit is contained in:
parent
053fd0c1c3
commit
b259f09b18
|
@ -59,8 +59,17 @@ static int do_push(const char *repo, int flags)
|
||||||
if (remote->mirror)
|
if (remote->mirror)
|
||||||
flags |= (TRANSPORT_PUSH_MIRROR|TRANSPORT_PUSH_FORCE);
|
flags |= (TRANSPORT_PUSH_MIRROR|TRANSPORT_PUSH_FORCE);
|
||||||
|
|
||||||
if ((flags & (TRANSPORT_PUSH_ALL|TRANSPORT_PUSH_MIRROR)) && refspec)
|
if ((flags & TRANSPORT_PUSH_ALL) && refspec) {
|
||||||
return -1;
|
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)) ==
|
if ((flags & (TRANSPORT_PUSH_ALL|TRANSPORT_PUSH_MIRROR)) ==
|
||||||
(TRANSPORT_PUSH_ALL|TRANSPORT_PUSH_MIRROR)) {
|
(TRANSPORT_PUSH_ALL|TRANSPORT_PUSH_MIRROR)) {
|
||||||
|
|
Loading…
Reference in a new issue