热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.eclipse.jgit.dircache.DirCache.editor()方法的使用及代码示例

本文整理了Java中org.eclipse.jgit.dircache.DirCache.editor()方法的一些代码示例,展示了DirCache.edi

本文整理了Java中org.eclipse.jgit.dircache.DirCache.editor()方法的一些代码示例,展示了DirCache.editor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DirCache.editor()方法的具体详情如下:
包路径:org.eclipse.jgit.dircache.DirCache
类名称:DirCache
方法名:editor

DirCache.editor介绍

[英]Create a new editor to recreate this cache.

Callers should add commands to the editor, then use org.eclipse.jgit.dircache.DirCacheEditor#finish() to update this instance.
[中]创建新编辑器以重新创建此缓存。
调用者应该在编辑器中添加命令,然后使用org。日食jgit。迪尔卡奇。DirCacheEditor#finish()更新此实例。

代码示例

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

DirCacheEditor editor = dc.editor();
while (treeWalk.next()) {
String path = treeWalk.getPathString();

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

DirCacheEditor editor = dc.editor();
String certText = pc.cert.toText() + pc.cert.getSignature();
final ObjectId certId = inserter.insert(OBJ_BLOB, certText.getBytes(UTF_8));

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

DirCacheEditor ed = contents.editor();
for (Command cmd : cmdList) {
if (!isValidRef(cmd)) {

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

private void checkoutPathsFromCommit(TreeWalk treeWalk, DirCache dc,
RevCommit commit) throws IOException {
treeWalk.addTree(commit.getTree());
final ObjectReader r = treeWalk.getObjectReader();
DirCacheEditor editor = dc.editor();
while (treeWalk.next()) {
final ObjectId blobId = treeWalk.getObjectId(0);
final FileMode mode = treeWalk.getFileMode(0);
final EolStreamType eolStreamType = treeWalk
.getEolStreamType(CHECKOUT_OP);
final String filterCommand = treeWalk
.getFilterCommand(Constants.ATTR_FILTER_TYPE_SMUDGE);
final String path = treeWalk.getPathString();
editor.add(new PathEdit(path) {
@Override
public void apply(DirCacheEntry ent) {
ent.setObjectId(blobId);
ent.setFileMode(mode);
checkoutPath(ent, r,
new CheckoutMetadata(eolStreamType, filterCommand));
actuallyModifiedPaths.add(path);
}
});
}
editor.commit();
}

代码示例来源:origin: com.beijunyi.parallelgit/parallelgit-utils

public static void deleteDirectory(@Nonnull String path, @Nonnull DirCache cache) {
DirCacheEditor editor = cache.editor();
deleteDirectory(path, editor);
editor.finish();
}

代码示例来源:origin: com.beijunyi.parallelgit/parallelgit-utils

public static void deleteFile(@Nonnull String path, @Nonnull DirCache cache) {
DirCacheEditor editor = cache.editor();
deleteFile(path, editor);
editor.finish();
}

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

DirCacheEditor editor = cache.editor();
for (PathEdit edit : wtEdits)
editor.add(edit);

代码示例来源:origin: line/centraldogma

private static void applyPathEdit(DirCache dirCache, PathEdit edit) {
final DirCacheEditor e = dirCache.editor();
e.add(edit);
e.finish();
}

代码示例来源:origin: com.beijunyi/parallelgit-utils

public static void deleteFile(String path, DirCache cache) {
DirCacheEditor editor = cache.editor();
deleteFile(path, editor);
editor.finish();
}

代码示例来源:origin: com.linecorp.centraldogma/centraldogma-server

private static void applyPathEdit(DirCache dirCache, PathEdit edit) {
final DirCacheEditor e = dirCache.editor();
e.add(edit);
e.finish();
}

代码示例来源:origin: com.beijunyi/parallelgit-utils

public static void deleteDirectory(String path, DirCache cache) {
DirCacheEditor editor = cache.editor();
deleteDirectory(path, editor);
editor.finish();
}

代码示例来源:origin: com.beijunyi/parallelgit-utils

public static void updateFile(CacheEntryUpdate update, DirCache cache) {
DirCacheEditor editor = cache.editor();
updateFile(update, editor);
editor.finish();
}

代码示例来源:origin: com.linecorp.centraldogma/centraldogma-server-shaded

private static void applyPathEdit(DirCache dirCache, PathEdit edit) {
final DirCacheEditor e = dirCache.editor();
e.add(edit);
e.finish();
}

代码示例来源:origin: beijunyi/ParallelGit

public static void deleteFile(String path, DirCache cache) {
DirCacheEditor editor = cache.editor();
deleteFile(path, editor);
editor.finish();
}

代码示例来源:origin: beijunyi/ParallelGit

public static void deleteDirectory(String path, DirCache cache) {
DirCacheEditor editor = cache.editor();
deleteDirectory(path, editor);
editor.finish();
}

代码示例来源:origin: beijunyi/ParallelGit

public static void updateFile(CacheEntryUpdate update, DirCache cache) {
DirCacheEditor editor = cache.editor();
updateFile(update, editor);
editor.finish();
}

代码示例来源:origin: kiegroup/appformer

public Optional 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);
}
}

代码示例来源:origin: org.uberfire/uberfire-nio2-jgit

private void mergeCommit(final Git origin,
final String targetBranchName,
final String sourceBranchName,
final TestFile... testFiles) throws Exception {
final Repository repo = origin.getRepository();
final org.eclipse.jgit.api.Git git = org.eclipse.jgit.api.Git.wrap(repo);
final ObjectId targetId = repo.resolve(targetBranchName);
final ObjectId sourceId = repo.resolve(sourceBranchName);
final DirCache dc = DirCache.newInCore();
final DirCacheEditor editor = dc.editor();
try (ObjectInserter inserter = repo.newObjectInserter()) {
final ObjectId treeId = writeTestFilesToTree(dc, editor, inserter, testFiles);
final ObjectId commitId = writeCommit(inserter, treeId, targetId, sourceId);
updateBranch(targetBranchName, git, commitId);
}
}

代码示例来源:origin: kiegroup/appformer

private void mergeCommit(final Git origin,
final String targetBranchName,
final String sourceBranchName,
final TestFile... testFiles) throws Exception {
final Repository repo = origin.getRepository();
final org.eclipse.jgit.api.Git git = org.eclipse.jgit.api.Git.wrap(repo);
final ObjectId targetId = repo.resolve(targetBranchName);
final ObjectId sourceId = repo.resolve(sourceBranchName);
final DirCache dc = DirCache.newInCore();
final DirCacheEditor editor = dc.editor();
try (ObjectInserter inserter = repo.newObjectInserter()) {
final ObjectId treeId = writeTestFilesToTree(dc, editor, inserter, testFiles);
final ObjectId commitId = writeCommit(inserter, treeId, targetId, sourceId);
updateBranch(targetBranchName, git, commitId);
}
}

代码示例来源:origin: beijunyi/ParallelGit

@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"));
}

推荐阅读
  • 标题: ... [详细]
  • 使用在线工具jsonschema2pojo根据json生成java对象
    本文介绍了使用在线工具jsonschema2pojo根据json生成java对象的方法。通过该工具,用户只需将json字符串复制到输入框中,即可自动将其转换成java对象。该工具还能解析列表式的json数据,并将嵌套在内层的对象也解析出来。本文以请求github的api为例,展示了使用该工具的步骤和效果。 ... [详细]
  • PHP中的单例模式与静态变量的区别及使用方法
    本文介绍了PHP中的单例模式与静态变量的区别及使用方法。在PHP中,静态变量的存活周期仅仅是每次PHP的会话周期,与Java、C++不同。静态变量在PHP中的作用域仅限于当前文件内,在函数或类中可以传递变量。本文还通过示例代码解释了静态变量在函数和类中的使用方法,并说明了静态变量的生命周期与结构体的生命周期相关联。同时,本文还介绍了静态变量在类中的使用方法,并通过示例代码展示了如何在类中使用静态变量。 ... [详细]
  • XML介绍与使用的概述及标签规则
    本文介绍了XML的基本概念和用途,包括XML的可扩展性和标签的自定义特性。同时还详细解释了XML标签的规则,包括标签的尖括号和合法标识符的组成,标签必须成对出现的原则以及特殊标签的使用方法。通过本文的阅读,读者可以对XML的基本知识有一个全面的了解。 ... [详细]
  • Google Play推出全新的应用内评价API,帮助开发者获取更多优质用户反馈。用户每天在Google Play上发表数百万条评论,这有助于开发者了解用户喜好和改进需求。开发者可以选择在适当的时间请求用户撰写评论,以获得全面而有用的反馈。全新应用内评价功能让用户无需返回应用详情页面即可发表评论,提升用户体验。 ... [详细]
  • 本文介绍了一个在线急等问题解决方法,即如何统计数据库中某个字段下的所有数据,并将结果显示在文本框里。作者提到了自己是一个菜鸟,希望能够得到帮助。作者使用的是ACCESS数据库,并且给出了一个例子,希望得到的结果是560。作者还提到自己已经尝试了使用"select sum(字段2) from 表名"的语句,得到的结果是650,但不知道如何得到560。希望能够得到解决方案。 ... [详细]
  • 本文介绍了iOS数据库Sqlite的SQL语句分类和常见约束关键字。SQL语句分为DDL、DML和DQL三种类型,其中DDL语句用于定义、删除和修改数据表,关键字包括create、drop和alter。常见约束关键字包括if not exists、if exists、primary key、autoincrement、not null和default。此外,还介绍了常见的数据库数据类型,包括integer、text和real。 ... [详细]
  • 本文详细介绍了git常用命令及其操作方法,包括查看、添加、提交、删除、找回等操作,以及如何重置修改文件、抛弃工作区修改、将工作文件提交到本地暂存区、从版本库中删除文件等。同时还介绍了如何从暂存区恢复到工作文件、恢复最近一次提交过的状态,以及如何合并多个操作等。 ... [详细]
  • EzPP 0.2发布,新增YAML布局渲染功能
    EzPP发布了0.2.1版本,新增了YAML布局渲染功能,可以将YAML文件渲染为图片,并且可以复用YAML作为模版,通过传递不同参数生成不同的图片。这个功能可以用于绘制Logo、封面或其他图片,让用户不需要安装或卸载Photoshop。文章还提供了一个入门例子,介绍了使用ezpp的基本渲染方法,以及如何使用canvas、text类元素、自定义字体等。 ... [详细]
  • 本文介绍了RxJava在Android开发中的广泛应用以及其在事件总线(Event Bus)实现中的使用方法。RxJava是一种基于观察者模式的异步java库,可以提高开发效率、降低维护成本。通过RxJava,开发者可以实现事件的异步处理和链式操作。对于已经具备RxJava基础的开发者来说,本文将详细介绍如何利用RxJava实现事件总线,并提供了使用建议。 ... [详细]
  • 十大经典排序算法动图演示+Python实现
    本文介绍了十大经典排序算法的原理、演示和Python实现。排序算法分为内部排序和外部排序,常见的内部排序算法有插入排序、希尔排序、选择排序、冒泡排序、归并排序、快速排序、堆排序、基数排序等。文章还解释了时间复杂度和稳定性的概念,并提供了相关的名词解释。 ... [详细]
  • 利用Visual Basic开发SAP接口程序初探的方法与原理
    本文介绍了利用Visual Basic开发SAP接口程序的方法与原理,以及SAP R/3系统的特点和二次开发平台ABAP的使用。通过程序接口自动读取SAP R/3的数据表或视图,在外部进行处理和利用水晶报表等工具生成符合中国人习惯的报表样式。具体介绍了RFC调用的原理和模型,并强调本文主要不讨论SAP R/3函数的开发,而是针对使用SAP的公司的非ABAP开发人员提供了初步的接口程序开发指导。 ... [详细]
  • 本文介绍了Linux Shell中括号和整数扩展的使用方法,包括命令组、命令替换、初始化数组以及算术表达式和逻辑判断的相关内容。括号中的命令将会在新开的子shell中顺序执行,括号中的变量不能被脚本余下的部分使用。命令替换可以用于将命令的标准输出作为另一个命令的输入。括号中的运算符和表达式符合C语言运算规则,可以用在整数扩展中进行算术计算和逻辑判断。 ... [详细]
  • Go Cobra命令行工具入门教程
    本文介绍了Go语言实现的命令行工具Cobra的基本概念、安装方法和入门实践。Cobra被广泛应用于各种项目中,如Kubernetes、Hugo和Github CLI等。通过使用Cobra,我们可以快速创建命令行工具,适用于写测试脚本和各种服务的Admin CLI。文章还通过一个简单的demo演示了Cobra的使用方法。 ... [详细]
  • 本文记录了在vue cli 3.x中移除console的一些采坑经验,通过使用uglifyjs-webpack-plugin插件,在vue.config.js中进行相关配置,包括设置minimizer、UglifyJsPlugin和compress等参数,最终成功移除了console。同时,还包括了一些可能出现的报错情况和解决方法。 ... [详细]
author-avatar
一二三
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有