summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorDave Borowitz <dborowitz@google.com>2015-03-12 12:14:47 -0700
committerDave Borowitz <dborowitz@google.com>2015-03-12 12:47:18 -0700
commit8b6f9ace1519d79d41ae0179c633cbd21219f7d8 (patch)
tree93421cece918461a5c8c40bb0ed334de04d505f7 /org.eclipse.jgit.test
parent6ed07f5cb5f5c296c8abca8ac06a6f923b96119c (diff)
downloadjgit-8b6f9ace1519d79d41ae0179c633cbd21219f7d8.tar.gz
jgit-8b6f9ace1519d79d41ae0179c633cbd21219f7d8.zip
TestRepository: Allow setting explicit Change-Id
This includes both leaving existing Change-Ids alone (as, for example Gerrit's commit-msg hook does) and programmatically setting a value. Change-Id: Iaaffb0107ae27de24df1f0e95a8d628fb8ea5364
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/junit/TestRepositoryTest.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/junit/TestRepositoryTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/junit/TestRepositoryTest.java
index 09259de7db..cefc779a27 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/junit/TestRepositoryTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/junit/TestRepositoryTest.java
@@ -113,6 +113,17 @@ public class TestRepositoryTest {
}
@Test
+ public void insertExplicitChangeId() throws Exception {
+ RevCommit c = tr.commit().message("message")
+ .insertChangeId("deadbeefdeadbeefdeadbeefdeadbeefdeadbeef")
+ .create();
+ rw.parseBody(c);
+ assertEquals("message\n\n"
+ + "Change-Id: Ideadbeefdeadbeefdeadbeefdeadbeefdeadbeef\n"
+ , c.getFullMessage());
+ }
+
+ @Test
public void resetFromSymref() throws Exception {
repo.updateRef("HEAD").link("refs/heads/master");
Ref head = repo.getRef("HEAD");