diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2011-03-14 08:08:39 -0700 |
---|---|---|
committer | Chris Aniszczyk <caniszczyk@gmail.com> | 2011-03-15 09:49:10 -0500 |
commit | 506ab8caa5e7f8cae71331867a4b32dae4cf832b (patch) | |
tree | 3f29411338a56de7fd3c33df04c98a6aa9a81e8d /org.eclipse.jgit.pgm/src | |
parent | 599a55e4473f493e6f6c696a2b864e918a8e6da4 (diff) | |
download | jgit-506ab8caa5e7f8cae71331867a4b32dae4cf832b.tar.gz jgit-506ab8caa5e7f8cae71331867a4b32dae4cf832b.zip |
PushCommand: Add utilities for --all, --tags
The --all flag on the command line implies using refs/heads/* as
a push specification. Add this to the standard command object.
The --tags flag on the command line implies using refs/tags/* as
a push specification. Add this to the standard command object.
Change-Id: Iaef200b17cce77604548dbfb15cf2499b10687b5
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.pgm/src')
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java index b6a10518a5..83f1ee1779 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java @@ -77,14 +77,10 @@ class Push extends TextBuiltin { private final List<RefSpec> refSpecs = new ArrayList<RefSpec>(); @Option(name = "--all") - void addAll(final boolean ignored) { - refSpecs.add(Transport.REFSPEC_PUSH_ALL); - } + private boolean all; @Option(name = "--tags") - void addTags(final boolean ignored) { - refSpecs.add(Transport.REFSPEC_TAGS); - } + private boolean tags; @Option(name = "--verbose", aliases = { "-v" }) private boolean verbose = false; @@ -117,6 +113,10 @@ class Push extends TextBuiltin { push.setProgressMonitor(new TextProgressMonitor()); push.setReceivePack(receivePack); push.setRefSpecs(refSpecs); + if (all) + push.setPushAll(); + if (tags) + push.setPushTags(); push.setRemote(remote); push.setThin(thin); push.setTimeout(timeout); |