summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2e13e5d)
raw | patch | inline | side by side (parent: 2e13e5d)
author | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 16 Oct 2007 04:25:34 +0000 (00:25 -0400) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 16 Oct 2007 04:25:56 +0000 (00:25 -0400) |
The builtin-fetch topic changed push's handling of --all to setting
the new TRANSPORT_PUSH_ALL flag before starting the push subroutine
for the given transport. Unfortunately not all references within
builtin-push were changed to test this flag therefore allowing push
to incorrectly accept refspecs and --all.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
the new TRANSPORT_PUSH_ALL flag before starting the push subroutine
for the given transport. Unfortunately not all references within
builtin-push were changed to test this flag therefore allowing push
to incorrectly accept refspecs and --all.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
builtin-push.c | patch | blob | history |
diff --git a/builtin-push.c b/builtin-push.c
index a552f0dac654bb532ecd43ec5c8cd15e113ef82c..4b39ef3852a5dcb9b099527d4aafc33ba3bb6da1 100644 (file)
--- a/builtin-push.c
+++ b/builtin-push.c
static const char push_usage[] = "git-push [--all] [--dry-run] [--tags] [--receive-pack=<git-receive-pack>] [--repo=all] [-f | --force] [-v] [<repository> <refspec>...]";
-static int all, thin, verbose;
+static int thin, verbose;
static const char *receivepack;
static const char **refspec;
if (!remote)
die("bad repository '%s'", repo);
- if (!refspec && !all && remote->push_refspec_nr) {
+ if (!refspec
+ && !(flags & TRANSPORT_PUSH_ALL)
+ && remote->push_refspec_nr) {
refspec = remote->push_refspec;
refspec_nr = remote->push_refspec_nr;
}
usage(push_usage);
}
set_refspecs(argv + i, argc - i);
- if (all && refspec)
+ if ((flags & TRANSPORT_PUSH_ALL) && refspec)
usage(push_usage);
return do_push(repo, flags);