public class RebaseTodoFile
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private Repository |
repo |
Constructor and Description |
---|
RebaseTodoFile(Repository repo)
Constructor for RebaseTodoFile.
|
Modifier and Type | Method and Description |
---|---|
private static int |
nextParsableToken(byte[] buf,
int tokenBegin,
int lineEnd)
Skip leading space, tab, CR and LF characters
|
private static void |
parseComments(byte[] buf,
int tokenBegin,
java.util.List<RebaseTodoLine> r,
int lineEnd) |
private static RebaseTodoLine |
parseLine(byte[] buf,
int tokenBegin,
int lineEnd) |
java.util.List<RebaseTodoLine> |
readRebaseTodo(java.lang.String path,
boolean includeComments)
Read a file formatted like the git-rebase-todo file.
|
void |
writeRebaseTodoFile(java.lang.String path,
java.util.List<RebaseTodoLine> steps,
boolean append)
Write a file formatted like a git-rebase-todo file.
|
private Repository repo
public RebaseTodoFile(Repository repo)
repo
- a Repository
object.public java.util.List<RebaseTodoLine> readRebaseTodo(java.lang.String path, boolean includeComments) throws java.io.IOException
path
- path to the file relative to the repository's git-dir. E.g.
"rebase-merge/git-rebase-todo" or "rebase-append/done"includeComments
- true
if also comments should be reportedjava.io.IOException
private static void parseComments(byte[] buf, int tokenBegin, java.util.List<RebaseTodoLine> r, int lineEnd)
private static int nextParsableToken(byte[] buf, int tokenBegin, int lineEnd)
buf
- tokenBegin
- lineEnd
- buf
that doesn't
need to be skipped, -1
if no such token found within the
range (i.e. empty line)private static RebaseTodoLine parseLine(byte[] buf, int tokenBegin, int lineEnd)
public void writeRebaseTodoFile(java.lang.String path, java.util.List<RebaseTodoLine> steps, boolean append) throws java.io.IOException
path
- path to the file relative to the repository's git-dir. E.g.
"rebase-merge/git-rebase-todo" or "rebase-append/done"steps
- the steps to be writtenappend
- whether to append to an existing file or to write a new filejava.io.IOException