diff options
author | Dave Borowitz <dborowitz@google.com> | 2015-03-12 12:14:47 -0700 |
---|---|---|
committer | Dave Borowitz <dborowitz@google.com> | 2015-03-12 12:47:18 -0700 |
commit | 8b6f9ace1519d79d41ae0179c633cbd21219f7d8 (patch) | |
tree | 93421cece918461a5c8c40bb0ed334de04d505f7 /org.eclipse.jgit.test | |
parent | 6ed07f5cb5f5c296c8abca8ac06a6f923b96119c (diff) | |
download | jgit-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.java | 11 |
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"); |