summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src/org/eclipse
diff options
context:
space:
mode:
authorTomasz Zarna <Tomasz.Zarna@pl.ibm.com>2011-12-18 16:28:44 +0100
committerTomasz Zarna <Tomasz.Zarna@pl.ibm.com>2011-12-18 16:28:44 +0100
commit8c60468ff4cae4a13f57ed4a1822cec7cb2ba22a (patch)
tree9bd7e23e5c4ea0a7caa609d0d723f6dc9feece1c /org.eclipse.jgit.pgm/src/org/eclipse
parentdc4c06e7acba79044fc3850a61971fec615632e5 (diff)
downloadjgit-8c60468ff4cae4a13f57ed4a1822cec7cb2ba22a.tar.gz
jgit-8c60468ff4cae4a13f57ed4a1822cec7cb2ba22a.zip
Allow to amend commits with JGit CLI
Change-Id: I0e8d365b56e079ac4ccece7fcf80ea140c319c78
Diffstat (limited to 'org.eclipse.jgit.pgm/src/org/eclipse')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java4
1 files changed, 4 insertions, 0 deletions
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 ba66a30a24..2ff9aa657f 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
@@ -67,6 +67,9 @@ class Commit extends TextBuiltin {
@Option(name = "--only", aliases = { "-o" }, usage = "usage_CommitOnly")
private boolean only;
+ @Option(name = "--amend", usage = "usage_CommitAmend")
+ private boolean amend;
+
@Argument(metaVar = "metaVar_commitPaths", usage = "usage_CommitPaths")
private List<String> paths = new ArrayList<String>();
@@ -83,6 +86,7 @@ class Commit extends TextBuiltin {
if (!paths.isEmpty())
for (String p : paths)
commitCmd.setOnly(p);
+ commitCmd.setAmend(amend);
Ref head = db.getRef(Constants.HEAD);
RevCommit commit = commitCmd.call();