aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Borowitz2012-06-15 14:05:12 (EDT)
committerDave Borowitz2012-06-15 14:43:22 (EDT)
commit9346f1cc942cf320130cb303f4299a027d8d306a (patch)
treedb2506328597a1d7ef4fd71debb17abc0c97cf23
parent458f64c6ea94da114cd99243302dfaacc7194d7c (diff)
downloadjgit-9346f1cc942cf320130cb303f4299a027d8d306a.zip
jgit-9346f1cc942cf320130cb303f4299a027d8d306a.tar.gz
jgit-9346f1cc942cf320130cb303f4299a027d8d306a.tar.bz2
Add a CommitBuilder method to edit arbitrary DirCacheEntrysrefs/changes/77/6377/2
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java8
1 files changed, 6 insertions, 2 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 1afc6d8..b36b5c7 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
@@ -793,14 +793,18 @@ public class TestRepository<R extends Repository> {
public CommitBuilder add(String path, final RevBlob id)
throws Exception {
- DirCacheEditor e = tree.editor();
- e.add(new PathEdit(path) {
+ return edit(new PathEdit(path) {
@Override
public void apply(DirCacheEntry ent) {
ent.setFileMode(FileMode.REGULAR_FILE);
ent.setObjectId(id);
}
});
+ }
+
+ public CommitBuilder edit(PathEdit edit) {
+ DirCacheEditor e = tree.editor();
+ e.add(edit);
e.finish();
return this;
}