diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2010-08-23 10:13:25 -0700 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2010-08-23 10:13:29 -0700 |
commit | 6df5d3397c5c9354409d21a8e207a061f2e6efc2 (patch) | |
tree | ac334cbeffe7a1616a0b24452e5c64004843106a /org.eclipse.jgit.pgm/src | |
parent | 22b285695a2980824c15363ef5fec709ebc3d434 (diff) | |
download | jgit-6df5d3397c5c9354409d21a8e207a061f2e6efc2.tar.gz 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.pgm/src')
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Tag.java | 2 | ||||
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Tag.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Tag.java index 0ab19b6bb9..19454b1868 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Tag.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Tag.java @@ -100,7 +100,7 @@ class Tag extends TextBuiltin { tag.setTagger(new PersonIdent(db)); tag.setMessage(message.replaceAll("\r", "")); tag.setTag(shortName); - id = inserter.insert(Constants.OBJ_TAG, inserter.format(tag)); + id = inserter.insert(tag); inserter.flush(); } finally { inserter.release(); diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java index ab44128713..b01734e00a 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java @@ -197,7 +197,7 @@ class RebuildCommitGraph extends TextBuiltin { newc.setCommitter(newc.getAuthor()); newc.setParentIds(newParents); newc.setMessage("ORIGINAL " + t.oldId.name() + "\n"); - t.newId = oi.insert(Constants.OBJ_COMMIT,oi.format(newc)); + t.newId = oi.insert(newc); rewrites.put(t.oldId, t.newId); pm.update(1); } |