org.eclipse.jgit.lib.Repository.writeHeadsFile()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(96)

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

Repository.writeHeadsFile介绍

[英]Write the given heads to a file in the git directory.
[中]将给定的头写入git目录中的文件。

代码示例

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

/**
 * Write new merge-heads into $GIT_DIR/MERGE_HEAD. In this file operations
 * triggering a merge will store the IDs of all heads which should be merged
 * together with HEAD. If <code>null</code> is specified as list of commits
 * the file will be deleted
 *
 * @param heads
 *            a list of commits which IDs should be written to
 *            $GIT_DIR/MERGE_HEAD or <code>null</code> to delete the file
 * @throws java.io.IOException
 */
public void writeMergeHeads(List<? extends ObjectId> heads) throws IOException {
  writeHeadsFile(heads, Constants.MERGE_HEAD);
}

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

/**
 * Write original HEAD commit into $GIT_DIR/ORIG_HEAD.
 *
 * @param head
 *            an object id of the original HEAD commit or <code>null</code>
 *            to delete the file
 * @throws java.io.IOException
 */
public void writeOrigHead(ObjectId head) throws IOException {
  List<ObjectId> heads = head != null ? Collections.singletonList(head)
      : null;
  writeHeadsFile(heads, Constants.ORIG_HEAD);
}

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

/**
 * Write cherry pick commit into $GIT_DIR/CHERRY_PICK_HEAD. This is used in
 * case of conflicts to store the cherry which was tried to be picked.
 *
 * @param head
 *            an object id of the cherry commit or <code>null</code> to
 *            delete the file
 * @throws java.io.IOException
 */
public void writeCherryPickHead(ObjectId head) throws IOException {
  List<ObjectId> heads = (head != null) ? Collections.singletonList(head)
      : null;
  writeHeadsFile(heads, Constants.CHERRY_PICK_HEAD);
}

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

/**
 * Write revert commit into $GIT_DIR/REVERT_HEAD. This is used in case of
 * conflicts to store the revert which was tried to be picked.
 *
 * @param head
 *            an object id of the revert commit or <code>null</code> to
 *            delete the file
 * @throws java.io.IOException
 */
public void writeRevertHead(ObjectId head) throws IOException {
  List<ObjectId> heads = (head != null) ? Collections.singletonList(head)
      : null;
  writeHeadsFile(heads, Constants.REVERT_HEAD);
}

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

/**
 * Write new merge-heads into $GIT_DIR/MERGE_HEAD. In this file operations
 * triggering a merge will store the IDs of all heads which should be merged
 * together with HEAD. If <code>null</code> is specified as list of commits
 * the file will be deleted
 *
 * @param heads
 *            a list of commits which IDs should be written to
 *            $GIT_DIR/MERGE_HEAD or <code>null</code> to delete the file
 * @throws IOException
 */
public void writeMergeHeads(List<? extends ObjectId> heads) throws IOException {
  writeHeadsFile(heads, Constants.MERGE_HEAD);
}

代码示例来源:origin: berlam/github-bucket

/**
 * Write new merge-heads into $GIT_DIR/MERGE_HEAD. In this file operations
 * triggering a merge will store the IDs of all heads which should be merged
 * together with HEAD. If <code>null</code> is specified as list of commits
 * the file will be deleted
 *
 * @param heads
 *            a list of commits which IDs should be written to
 *            $GIT_DIR/MERGE_HEAD or <code>null</code> to delete the file
 * @throws java.io.IOException
 */
public void writeMergeHeads(List<? extends ObjectId> heads) throws IOException {
  writeHeadsFile(heads, Constants.MERGE_HEAD);
}

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

/**
 * Write original HEAD commit into $GIT_DIR/ORIG_HEAD.
 *
 * @param head
 *            an object id of the original HEAD commit or <code>null</code>
 *            to delete the file
 * @throws IOException
 */
public void writeOrigHead(ObjectId head) throws IOException {
  List<ObjectId> heads = head != null ? Collections.singletonList(head)
      : null;
  writeHeadsFile(heads, Constants.ORIG_HEAD);
}

代码示例来源:origin: berlam/github-bucket

/**
 * Write original HEAD commit into $GIT_DIR/ORIG_HEAD.
 *
 * @param head
 *            an object id of the original HEAD commit or <code>null</code>
 *            to delete the file
 * @throws java.io.IOException
 */
public void writeOrigHead(ObjectId head) throws IOException {
  List<ObjectId> heads = head != null ? Collections.singletonList(head)
      : null;
  writeHeadsFile(heads, Constants.ORIG_HEAD);
}

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

/**
 * Write cherry pick commit into $GIT_DIR/CHERRY_PICK_HEAD. This is used in
 * case of conflicts to store the cherry which was tried to be picked.
 *
 * @param head
 *            an object id of the cherry commit or <code>null</code> to
 *            delete the file
 * @throws IOException
 */
public void writeCherryPickHead(ObjectId head) throws IOException {
  List<ObjectId> heads = (head != null) ? Collections.singletonList(head)
      : null;
  writeHeadsFile(heads, Constants.CHERRY_PICK_HEAD);
}

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

/**
 * Write revert commit into $GIT_DIR/REVERT_HEAD. This is used in case of
 * conflicts to store the revert which was tried to be picked.
 *
 * @param head
 *            an object id of the revert commit or <code>null</code> to
 *            delete the file
 * @throws IOException
 */
public void writeRevertHead(ObjectId head) throws IOException {
  List<ObjectId> heads = (head != null) ? Collections.singletonList(head)
      : null;
  writeHeadsFile(heads, Constants.REVERT_HEAD);
}

代码示例来源:origin: berlam/github-bucket

/**
 * Write cherry pick commit into $GIT_DIR/CHERRY_PICK_HEAD. This is used in
 * case of conflicts to store the cherry which was tried to be picked.
 *
 * @param head
 *            an object id of the cherry commit or <code>null</code> to
 *            delete the file
 * @throws java.io.IOException
 */
public void writeCherryPickHead(ObjectId head) throws IOException {
  List<ObjectId> heads = (head != null) ? Collections.singletonList(head)
      : null;
  writeHeadsFile(heads, Constants.CHERRY_PICK_HEAD);
}

代码示例来源:origin: berlam/github-bucket

/**
 * Write revert commit into $GIT_DIR/REVERT_HEAD. This is used in case of
 * conflicts to store the revert which was tried to be picked.
 *
 * @param head
 *            an object id of the revert commit or <code>null</code> to
 *            delete the file
 * @throws java.io.IOException
 */
public void writeRevertHead(ObjectId head) throws IOException {
  List<ObjectId> heads = (head != null) ? Collections.singletonList(head)
      : null;
  writeHeadsFile(heads, Constants.REVERT_HEAD);
}

相关文章

Repository类方法