aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src
diff options
context:
space:
mode:
authorTomasz Zarna <Tomasz.Zarna@pl.ibm.com>2012-04-30 15:18:07 +0200
committerChris Aniszczyk <zx@twitter.com>2012-05-10 18:31:33 -0700
commit94285e691a914ab5fe2f1a161fbce0f0fd539058 (patch)
tree96ebde7acad2f1a2df3dd2506154abfbbe57234a /org.eclipse.jgit.pgm/src
parentef98c3ec8671f8ba8f0b942c41e305893b3c08f7 (diff)
downloadjgit-94285e691a914ab5fe2f1a161fbce0f0fd539058.tar.gz
jgit-94285e691a914ab5fe2f1a161fbce0f0fd539058.zip
Add --all switch to org.eclipse.jgit.pgm.Commit
Change-Id: Iab52f995676daf60e0dfa043cc9e022f6e32a758 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
Diffstat (limited to 'org.eclipse.jgit.pgm/src')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java3
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java8
2 files changed, 9 insertions, 2 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java
index e1c26adf4c..b3b23837ae 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010, Sasa Zivkov <sasa.zivkov@sap.com>
+ * Copyright (C) 2010, 2012 Sasa Zivkov <sasa.zivkov@sap.com>
* and other copyright owners as documented in the project's IP log.
*
* This program and the accompanying materials are made available
@@ -170,6 +170,7 @@ public class CLIText extends TranslationBundle {
/***/ public String notFound;
/***/ public String noteObjectTooLargeToPrint;
/***/ public String onlyOneMetaVarExpectedIn;
+ /***/ public String onlyOneOfIncludeOnlyAllInteractiveCanBeUsed;
/***/ public String pushTo;
/***/ public String pathsRequired;
/***/ public String refDoesNotExistOrNoCommit;
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java
index 2ff9aa657f..cc7539b98e 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010, Christian Halstrick <christian.halstrick@sap.com> and
+ * Copyright (C) 2010, 2012 Christian Halstrick <christian.halstrick@sap.com> and
* other copyright owners as documented in the project's IP log.
*
* This program and the accompanying materials are made available under the
@@ -67,6 +67,9 @@ class Commit extends TextBuiltin {
@Option(name = "--only", aliases = { "-o" }, usage = "usage_CommitOnly")
private boolean only;
+ @Option(name = "--all", aliases = { "-a" }, usage = "usage_CommitAll")
+ private boolean all;
+
@Option(name = "--amend", usage = "usage_CommitAmend")
private boolean amend;
@@ -83,10 +86,13 @@ class Commit extends TextBuiltin {
commitCmd.setMessage(message);
if (only && paths.isEmpty())
throw die(CLIText.get().pathsRequired);
+ if (only && all)
+ throw die(CLIText.get().onlyOneOfIncludeOnlyAllInteractiveCanBeUsed);
if (!paths.isEmpty())
for (String p : paths)
commitCmd.setOnly(p);
commitCmd.setAmend(amend);
+ commitCmd.setAll(all);
Ref head = db.getRef(Constants.HEAD);
RevCommit commit = commitCmd.call();