summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.junit
diff options
context:
space:
mode:
authorDave Borowitz <dborowitz@google.com>2012-06-15 11:05:12 -0700
committerDave Borowitz <dborowitz@google.com>2012-06-15 11:43:22 -0700
commit9346f1cc942cf320130cb303f4299a027d8d306a (patch)
treedb2506328597a1d7ef4fd71debb17abc0c97cf23 /org.eclipse.jgit.junit
parent458f64c6ea94da114cd99243302dfaacc7194d7c (diff)
downloadjgit-9346f1cc942cf320130cb303f4299a027d8d306a.tar.gz
jgit-9346f1cc942cf320130cb303f4299a027d8d306a.zip
Add a CommitBuilder method to edit arbitrary DirCacheEntrys
Change-Id: Ic2f5ec28621219a8ff1272674e2bf2c8d36eb107
Diffstat (limited to 'org.eclipse.jgit.junit')
-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 1afc6d808d..b36b5c761f 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;
}