}
}
+ @Test
+ public void commitOnlyShouldHandleIgnored() throws Exception {
+ try (Git git = new Git(db)) {
+ writeTrashFile("subdir/foo", "Hello World");
+ writeTrashFile("subdir/bar", "Hello World");
+ writeTrashFile(".gitignore", "bar");
+ git.add().addFilepattern("subdir").call();
+ git.commit().setOnly("subdir").setMessage("first commit").call();
+ }
+ }
+
private static void addUnmergedEntry(String file, DirCacheBuilder builder) {
DirCacheEntry stage1 = new DirCacheEntry(file, DirCacheEntry.STAGE_1);
DirCacheEntry stage2 = new DirCacheEntry(file, DirCacheEntry.STAGE_2);
// check if entry refers to a tracked file
boolean tracked = dcTree != null || hTree != null;
if (!tracked)
- break;
+ continue;
// for an unmerged path, DirCacheBuildIterator will yield 3
// entries, we only want to add one