本文整理了Java中org.eclipse.jgit.lib.Repository.readRebaseTodo
方法的一些代码示例,展示了Repository.readRebaseTodo
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Repository.readRebaseTodo
方法的具体详情如下:
包路径:org.eclipse.jgit.lib.Repository
类名称:Repository
方法名:readRebaseTodo
[英]Read a file formatted like the git-rebase-todo file. The "done" file is also formatted like the git-rebase-todo file. These files can be found in .git/rebase-merge/ or .git/rebase-append/ folders.
[中]读取格式类似git rebase todo文件的文件。“done”文件的格式也与git-rebase-todo文件类似。这些文件可以在中找到。git/rebase合并/或。git/rebase append/folders。
代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit
/**
* Removes the number of lines given in the parameter from the
* <code>git-rebase-todo</code> file but preserves comments and other lines
* that can not be parsed as steps
*
* @param numSteps
* @throws IOException
*/
private void popSteps(int numSteps) throws IOException {
if (numSteps == 0)
return;
List<RebaseTodoLine> todoLines = new LinkedList<>();
List<RebaseTodoLine> poppedLines = new LinkedList<>();
for (RebaseTodoLine line : repo.readRebaseTodo(
rebaseState.getPath(GIT_REBASE_TODO), true)) {
if (poppedLines.size() >= numSteps
|| RebaseTodoLine.Action.COMMENT.equals(line.getAction()))
todoLines.add(line);
else
poppedLines.add(line);
}
repo.writeRebaseTodoFile(rebaseState.getPath(GIT_REBASE_TODO),
todoLines, false);
if (poppedLines.size() > 0) {
repo.writeRebaseTodoFile(rebaseState.getPath(DONE), poppedLines,
true);
}
}
代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit
List<RebaseTodoLine> steps = repo.readRebaseTodo(
rebaseState.getPath(GIT_REBASE_TODO), false);
RebaseTodoLine nextStep = steps.size() > 0 ? steps.get(0) : null;
代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit
List<RebaseTodoLine> doneLines = repo.readRebaseTodo(
rebaseState.getPath(DONE), true);
RebaseTodoLine step = doneLines.get(doneLines.size() - 1);
newHead = checkoutCurrentHead();
List<RebaseTodoLine> steps = repo.readRebaseTodo(
rebaseState.getPath(GIT_REBASE_TODO), false);
if (steps.size() == 0) {
代码示例来源:origin: berlam/github-bucket
/**
* Removes the number of lines given in the parameter from the
* <code>git-rebase-todo</code> file but preserves comments and other lines
* that can not be parsed as steps
*
* @param numSteps
* @throws IOException
*/
private void popSteps(int numSteps) throws IOException {
if (numSteps == 0)
return;
List<RebaseTodoLine> todoLines = new LinkedList<>();
List<RebaseTodoLine> poppedLines = new LinkedList<>();
for (RebaseTodoLine line : repo.readRebaseTodo(
rebaseState.getPath(GIT_REBASE_TODO), true)) {
if (poppedLines.size() >= numSteps
|| RebaseTodoLine.Action.COMMENT.equals(line.getAction()))
todoLines.add(line);
else
poppedLines.add(line);
}
repo.writeRebaseTodoFile(rebaseState.getPath(GIT_REBASE_TODO),
todoLines, false);
if (poppedLines.size() > 0) {
repo.writeRebaseTodoFile(rebaseState.getPath(DONE), poppedLines,
true);
}
}
代码示例来源:origin: sonia.jgit/org.eclipse.jgit
/**
* Removes the number of lines given in the parameter from the
* <code>git-rebase-todo</code> file but preserves comments and other lines
* that can not be parsed as steps
*
* @param numSteps
* @throws IOException
*/
private void popSteps(int numSteps) throws IOException {
if (numSteps == 0)
return;
List<RebaseTodoLine> todoLines = new LinkedList<RebaseTodoLine>();
List<RebaseTodoLine> poppedLines = new LinkedList<RebaseTodoLine>();
for (RebaseTodoLine line : repo.readRebaseTodo(
rebaseState.getPath(GIT_REBASE_TODO), true)) {
if (poppedLines.size() >= numSteps
|| RebaseTodoLine.Action.COMMENT.equals(line.getAction()))
todoLines.add(line);
else
poppedLines.add(line);
}
repo.writeRebaseTodoFile(rebaseState.getPath(GIT_REBASE_TODO),
todoLines, false);
if (poppedLines.size() > 0) {
repo.writeRebaseTodoFile(rebaseState.getPath(DONE), poppedLines,
true);
}
}
代码示例来源:origin: sonia.jgit/org.eclipse.jgit
List<RebaseTodoLine> steps = repo.readRebaseTodo(
rebaseState.getPath(GIT_REBASE_TODO), false);
RebaseTodoLine nextStep = steps.size() > 0 ? steps.get(0) : null;
代码示例来源:origin: berlam/github-bucket
List<RebaseTodoLine> steps = repo.readRebaseTodo(
rebaseState.getPath(GIT_REBASE_TODO), false);
RebaseTodoLine nextStep = steps.size() > 0 ? steps.get(0) : null;
代码示例来源:origin: sonia.jgit/org.eclipse.jgit
List<RebaseTodoLine> doneLines = repo.readRebaseTodo(
rebaseState.getPath(DONE), true);
RebaseTodoLine step = doneLines.get(doneLines.size() - 1);
newHead = checkoutCurrentHead();
List<RebaseTodoLine> steps = repo.readRebaseTodo(
rebaseState.getPath(GIT_REBASE_TODO), false);
if (steps.size() == 0) {
代码示例来源:origin: berlam/github-bucket
List<RebaseTodoLine> doneLines = repo.readRebaseTodo(
rebaseState.getPath(DONE), true);
RebaseTodoLine step = doneLines.get(doneLines.size() - 1);
newHead = checkoutCurrentHead();
List<RebaseTodoLine> steps = repo.readRebaseTodo(
rebaseState.getPath(GIT_REBASE_TODO), false);
if (steps.size() == 0) {
内容来源于网络,如有侵权,请联系作者删除!