return curr; editor.finish(); CommitBuilder cb = new CommitBuilder(); cb.setAuthor(pc.ident);
ed.finish(); return true; } catch (DirCacheNameConflictException e) {
public static void deleteDirectory(@Nonnull String path, @Nonnull DirCache cache) { DirCacheEditor editor = cache.editor(); deleteDirectory(path, editor); editor.finish(); }
public static void deleteFile(@Nonnull String path, @Nonnull DirCache cache) { DirCacheEditor editor = cache.editor(); deleteFile(path, editor); editor.finish(); }
for (String path : wtDeletes) editor.add(new DeletePath(path)); editor.finish();
private static void applyPathEdit(DirCache dirCache, PathEdit edit) { final DirCacheEditor e = dirCache.editor(); e.add(edit); e.finish(); }
public static void deleteFile(String path, DirCache cache) { DirCacheEditor editor = cache.editor(); deleteFile(path, editor); editor.finish(); }
private static void applyPathEdit(DirCache dirCache, PathEdit edit) { final DirCacheEditor e = dirCache.editor(); e.add(edit); e.finish(); }
public static void deleteDirectory(String path, DirCache cache) { DirCacheEditor editor = cache.editor(); deleteDirectory(path, editor); editor.finish(); }
public static void updateFile(CacheEntryUpdate update, DirCache cache) { DirCacheEditor editor = cache.editor(); updateFile(update, editor); editor.finish(); }
public static void updateFile(CacheEntryUpdate update, DirCache cache) { DirCacheEditor editor = cache.editor(); updateFile(update, editor); editor.finish(); }
private static void applyPathEdit(DirCache dirCache, PathEdit edit) { final DirCacheEditor e = dirCache.editor(); e.add(edit); e.finish(); }
public static void deleteFile(String path, DirCache cache) { DirCacheEditor editor = cache.editor(); deleteFile(path, editor); editor.finish(); }
public static void deleteDirectory(String path, DirCache cache) { DirCacheEditor editor = cache.editor(); deleteDirectory(path, editor); editor.finish(); }
private ObjectId writeTestFilesToTree(final DirCache dc, final DirCacheEditor editor, ObjectInserter inserter, final TestFile... testFiles) throws Exception { for (TestFile data : testFiles) { writeBlob(editor, inserter, data); } editor.finish(); final ObjectId commitTreeId = dc.writeTree(inserter); return commitTreeId; }
private ObjectId writeTestFilesToTree(final DirCache dc, final DirCacheEditor editor, ObjectInserter inserter, final TestFile... testFiles) throws Exception { for (TestFile data : testFiles) { writeBlob(editor, inserter, data); } editor.finish(); final ObjectId commitTreeId = dc.writeTree(inserter); return commitTreeId; }
public Optional<ObjectId> execute() { final DirCacheEditor editor = DirCache.newInCore().editor(); try { iterateOverTreeWalk(git, headId, (walkPath, hTree) -> { addToTemporaryInCoreIndex(editor, new DirCacheEntry(walkPath), hTree.getEntryObjectId(), hTree.getEntryFileMode()); }); editor.finish(); } catch (final Exception e) { throw new RuntimeException(e); } return buildTree(editor); } }
public Optional<ObjectId> execute() { final Map<String, String> content = commitContent.getContent(); final DirCacheEditor editor = DirCache.newInCore().editor(); try { iterateOverTreeWalk(git, headId, (walkPath, hTree) -> { final String toPath = content.get(walkPath); addToTemporaryInCoreIndex(editor, new DirCacheEntry(walkPath), hTree.getEntryObjectId(), hTree.getEntryFileMode()); if (toPath != null) { addToTemporaryInCoreIndex(editor, new DirCacheEntry(toPath), hTree.getEntryObjectId(), hTree.getEntryFileMode()); } }); editor.finish(); } catch (final Exception e) { throw new RuntimeException(e); } return buildTree(editor); } }
@Test public void deleteMultipleTreesTest() { DirCache cache = setupCache("a/b/c1.txt", "a/b/c2.txt", "a/d/c3.txt", "a/d/c4.txt", "a/c5.txt", "a/c6.txt"); DirCacheEditor editor = cache.editor(); CacheUtils.deleteDirectory("a/b", editor); CacheUtils.deleteDirectory("a/d", editor); editor.finish(); assertEquals(2, cache.getEntryCount()); assertNotNull(cache.getEntry("a/c5.txt")); assertNotNull(cache.getEntry("a/c6.txt")); }
@Test public void deleteFilesWithDirCacheEditorTest() { DirCache cache = setupCache("a/b/c1.txt", "a/b/c2.txt", "a/c3.txt", "a/c4.txt", "a/c5.txt", "a/c6.txt"); DirCacheEditor editor = cache.editor(); CacheUtils.deleteFile("a/b/c1.txt", editor); CacheUtils.deleteFile("a/c3.txt", editor); CacheUtils.deleteFile("a/c4.txt", editor); CacheUtils.deleteFile("a/c6.txt", editor); editor.finish(); assertEquals(2, cache.getEntryCount()); assertNull(cache.getEntry("a/b/c1.txt")); assertNotNull(cache.getEntry("a/b/c2.txt")); assertNotNull(cache.getEntry("a/c5.txt")); }