本文整理了Java中org.eclipse.jgit.lib.Repository.writeOrigHead
方法的一些代码示例,展示了Repository.writeOrigHead
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Repository.writeOrigHead
方法的具体详情如下:
包路径:org.eclipse.jgit.lib.Repository
类名称:Repository
方法名:writeOrigHead
[英]Write original HEAD commit into $GIT_DIR/ORIG_HEAD.
[中]将原始头提交写入$GIT_DIR/ORIG_HEAD。
代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit
private void resetSoftToParent() throws IOException,
GitAPIException, CheckoutConflictException {
Ref ref = repo.exactRef(Constants.ORIG_HEAD);
ObjectId orig_head = ref == null ? null : ref.getObjectId();
try (Git git = Git.wrap(repo)) {
// we have already committed the cherry-picked commit.
// what we need is to have changes introduced by this
// commit to be on the index
// resetting is a workaround
git.reset().setMode(ResetType.SOFT)
.setRef("HEAD~1").call(); //$NON-NLS-1$
} finally {
// set ORIG_HEAD back to where we started because soft
// reset moved it
repo.writeOrigHead(orig_head);
}
}
代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit
repo.writeOrigHead(origHead);
代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit
repo.writeOrigHead(headId);
rebaseState.createFile(REBASE_HEAD, headId.name());
rebaseState.createFile(HEAD_NAME, headName);
代码示例来源:origin: sonia.jgit/org.eclipse.jgit
private void resetSoftToParent() throws IOException,
GitAPIException, CheckoutConflictException {
Ref ref = repo.exactRef(Constants.ORIG_HEAD);
ObjectId orig_head = ref == null ? null : ref.getObjectId();
try {
// we have already commited the cherry-picked commit.
// what we need is to have changes introduced by this
// commit to be on the index
// resetting is a workaround
Git.wrap(repo).reset().setMode(ResetType.SOFT)
.setRef("HEAD~1").call(); //$NON-NLS-1$
} finally {
// set ORIG_HEAD back to where we started because soft
// reset moved it
repo.writeOrigHead(orig_head);
}
}
代码示例来源:origin: berlam/github-bucket
private void resetSoftToParent() throws IOException,
GitAPIException, CheckoutConflictException {
Ref ref = repo.exactRef(Constants.ORIG_HEAD);
ObjectId orig_head = ref == null ? null : ref.getObjectId();
try (Git git = Git.wrap(repo)) {
// we have already committed the cherry-picked commit.
// what we need is to have changes introduced by this
// commit to be on the index
// resetting is a workaround
git.reset().setMode(ResetType.SOFT)
.setRef("HEAD~1").call(); //$NON-NLS-1$
} finally {
// set ORIG_HEAD back to where we started because soft
// reset moved it
repo.writeOrigHead(orig_head);
}
}
代码示例来源:origin: sonia.jgit/org.eclipse.jgit
repo.writeOrigHead(origHead);
代码示例来源:origin: berlam/github-bucket
repo.writeOrigHead(origHead);
代码示例来源:origin: sonia.jgit/org.eclipse.jgit
repo.writeOrigHead(headId);
rebaseState.createFile(REBASE_HEAD, headId.name());
rebaseState.createFile(HEAD_NAME, headName);
代码示例来源:origin: berlam/github-bucket
repo.writeOrigHead(headId);
rebaseState.createFile(REBASE_HEAD, headId.name());
rebaseState.createFile(HEAD_NAME, headName);
内容来源于网络,如有侵权,请联系作者删除!