aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse
diff options
context:
space:
mode:
authorTomasz Zarna <Tomasz.Zarna@pl.ibm.com>2011-03-07 16:33:53 +0100
committerChris Aniszczyk <caniszczyk@gmail.com>2011-03-07 10:19:20 -0600
commitcda64073fd45d3056486b96877e4ff6dd12dbaa5 (patch)
treebfbad54b17495460f1cca2dcfdd9e61e9e9e9f33 /org.eclipse.jgit.test/tst/org/eclipse
parent440d7f41270f18f430b40d4ce3873d84593a5533 (diff)
downloadjgit-cda64073fd45d3056486b96877e4ff6dd12dbaa5.tar.gz
jgit-cda64073fd45d3056486b96877e4ff6dd12dbaa5.zip
Allow to amend a commit with CommitCommand
Bug: 339088 Change-Id: I57dc727688c4bb6968ac076b176661c857c05afa Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitAndLogCommandTests.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitAndLogCommandTests.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitAndLogCommandTests.java
index f8e1e03b5b..5fa2c8154f 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitAndLogCommandTests.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitAndLogCommandTests.java
@@ -238,4 +238,21 @@ public class CommitAndLogCommandTests extends RepositoryTestCase {
}
assertEquals(l, -1);
}
+
+ @Test
+ public void testCommitAmend() throws NoHeadException, NoMessageException,
+ UnmergedPathException, ConcurrentRefUpdateException,
+ JGitInternalException, WrongRepositoryStateException {
+ Git git = new Git(db);
+ git.commit().setMessage("first comit").call(); // typo
+ git.commit().setAmend(true).setMessage("first commit").call();
+
+ Iterable<RevCommit> commits = git.log().call();
+ int c = 0;
+ for (RevCommit commit : commits) {
+ assertEquals("first commit", commit.getFullMessage());
+ c++;
+ }
+ assertEquals(1, c);
+ }
}