Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn O. Pearce2010-08-23 17:13:25 +0000
committerShawn O. Pearce2010-08-23 17:13:29 +0000
commit6df5d3397c5c9354409d21a8e207a061f2e6efc2 (patch)
treeac334cbeffe7a1616a0b24452e5c64004843106a /org.eclipse.jgit.junit/src
parent22b285695a2980824c15363ef5fec709ebc3d434 (diff)
downloadjgit-6df5d3397c5c9354409d21a8e207a061f2e6efc2.tar.gz
jgit-6df5d3397c5c9354409d21a8e207a061f2e6efc2.tar.xz
jgit-6df5d3397c5c9354409d21a8e207a061f2e6efc2.zip
Move commit and tag formatting to CommitBuilder, TagBuilder
These objects should be responsible for their own formatting, rather than delegating it to some obtuse type called ObjectInserter. While we are at it, simplify the way we insert these into a database. Passing in the type and calling format in application code turned out to be a huge mistake in terms of ease-of-use of the insert API. Change-Id: Id5bb95ee56aa2a002243e9b7853b84ec8df1d7bf Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.junit/src')
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java7
1 files changed, 3 insertions, 4 deletions
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 6e1f1db397..7a95ccd368 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
@@ -368,7 +368,7 @@ public class TestRepository<R extends Repository> {
c.setMessage("");
ObjectId id;
try {
- id = inserter.insert(Constants.OBJ_COMMIT, inserter.format(c));
+ id = inserter.insert(c);
inserter.flush();
} finally {
inserter.release();
@@ -405,7 +405,7 @@ public class TestRepository<R extends Repository> {
t.setMessage("");
ObjectId id;
try {
- id = inserter.insert(Constants.OBJ_TAG, inserter.format(t));
+ id = inserter.insert(t);
inserter.flush();
} finally {
inserter.release();
@@ -822,8 +822,7 @@ public class TestRepository<R extends Repository> {
ObjectId commitId;
try {
c.setTreeId(tree.writeTree(inserter));
- commitId = inserter.insert(Constants.OBJ_COMMIT, inserter
- .format(c));
+ commitId = inserter.insert(c);
inserter.flush();
} finally {
inserter.release();

Back to the top