Package org.eclipse.jgit.lib
Class RebaseTodoFile
java.lang.Object
org.eclipse.jgit.lib.RebaseTodoFile
Offers methods to read and write files formatted like the git-rebase-todo
file
- Since:
- 3.2
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static int
nextParsableToken
(byte[] buf, int tokenBegin, int lineEnd) Skip leading space, tab, CR and LF charactersprivate static void
parseComments
(byte[] buf, int tokenBegin, List<RebaseTodoLine> r, int lineEnd) private static RebaseTodoLine
parseLine
(byte[] buf, int tokenBegin, int lineEnd) readRebaseTodo
(String path, boolean includeComments) Read a file formatted like the git-rebase-todo file.void
writeRebaseTodoFile
(String path, List<RebaseTodoLine> steps, boolean append) Write a file formatted like a git-rebase-todo file.
-
Field Details
-
repo
-
-
Constructor Details
-
RebaseTodoFile
Constructor for RebaseTodoFile.- Parameters:
repo
- aRepository
object.
-
-
Method Details
-
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.- Parameters:
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 reported- Returns:
- the list of steps
- Throws:
IOException
-
parseComments
-
nextParsableToken
private static int nextParsableToken(byte[] buf, int tokenBegin, int lineEnd) Skip leading space, tab, CR and LF characters- Parameters:
buf
-tokenBegin
-lineEnd
-- Returns:
- the token within the range of the given
buf
that doesn't need to be skipped,-1
if no such token found within the range (i.e. empty line)
-
parseLine
-
writeRebaseTodoFile
public void writeRebaseTodoFile(String path, List<RebaseTodoLine> steps, boolean append) throws IOException Write a file formatted like a git-rebase-todo file.- Parameters:
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 file- Throws:
IOException
-