From 3e2b9b691ed30d53750cc08c2b89577b78e6d19a Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Thu, 4 Nov 2010 18:14:00 -0700 Subject: Allow writing a NoteMap back to the repository This is necessary to allow applications to wrap the note tree in a commit and update the note branch with the new state. Change-Id: Idbd7ead4a1b16ae2b64a30a4a01a29cfed548cdf Signed-off-by: Shawn O. Pearce --- .../src/org/eclipse/jgit/junit/TestRepository.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'org.eclipse.jgit.junit/src') diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java index 7a95ccd368..e74af8cf71 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java @@ -183,6 +183,17 @@ public class TestRepository { now += secDelta * 1000L; } + /** + * Set the author and committer using {@link #getClock()}. + * + * @param c + * the commit builder to store. + */ + public void setAuthorAndCommitter(org.eclipse.jgit.lib.CommitBuilder c) { + c.setAuthor(new PersonIdent(author, new Date(now))); + c.setCommitter(new PersonIdent(committer, new Date(now))); + } + /** * Create a new blob object in the repository. * @@ -815,8 +826,7 @@ public class TestRepository { c = new org.eclipse.jgit.lib.CommitBuilder(); c.setParentIds(parents); - c.setAuthor(new PersonIdent(author, new Date(now))); - c.setCommitter(new PersonIdent(committer, new Date(now))); + setAuthorAndCommitter(c); c.setMessage(message); ObjectId commitId; -- cgit v1.2.3