public class DiffCommand extends GitCommand<java.util.List<DiffEntry>>
Modifier and Type | Field and Description |
---|---|
private boolean |
cached |
private int |
contextLines |
private java.lang.String |
destinationPrefix |
private ProgressMonitor |
monitor |
private AbstractTreeIterator |
newTree |
private AbstractTreeIterator |
oldTree |
private java.io.OutputStream |
out |
private TreeFilter |
pathFilter |
private boolean |
showNameAndStatusOnly |
private java.lang.String |
sourcePrefix |
repo
Modifier | Constructor and Description |
---|---|
protected |
DiffCommand(Repository repo)
Constructor for DiffCommand
|
Modifier and Type | Method and Description |
---|---|
java.util.List<DiffEntry> |
call() |
private DiffFormatter |
getDiffFormatter() |
DiffCommand |
setCached(boolean cached)
Whether to view the changes staged for the next commit
|
DiffCommand |
setContextLines(int contextLines)
Set number of context lines instead of the usual three.
|
DiffCommand |
setDestinationPrefix(java.lang.String destinationPrefix)
Set the given destination prefix instead of "b/".
|
DiffCommand |
setNewTree(AbstractTreeIterator newTree)
Set new tree
|
DiffCommand |
setOldTree(AbstractTreeIterator oldTree)
Set old tree
|
DiffCommand |
setOutputStream(java.io.OutputStream out)
Set output stream
|
DiffCommand |
setPathFilter(TreeFilter pathFilter)
Set path filter
|
DiffCommand |
setProgressMonitor(ProgressMonitor monitor)
The progress monitor associated with the diff operation.
|
DiffCommand |
setShowNameAndStatusOnly(boolean showNameAndStatusOnly)
Set whether to return only names and status of changed files
|
DiffCommand |
setSourcePrefix(java.lang.String sourcePrefix)
Set the given source prefix instead of "a/".
|
checkCallable, getRepository, setCallable
private AbstractTreeIterator oldTree
private AbstractTreeIterator newTree
private boolean cached
private TreeFilter pathFilter
private boolean showNameAndStatusOnly
private java.io.OutputStream out
private int contextLines
private java.lang.String sourcePrefix
private java.lang.String destinationPrefix
private ProgressMonitor monitor
protected DiffCommand(Repository repo)
repo
- a Repository
object.private DiffFormatter getDiffFormatter()
public java.util.List<DiffEntry> call() throws GitAPIException
Execute the command
Executes the Diff
command with all the options and parameters
collected by the setter methods (e.g. setCached(boolean)
of this
class. Each instance of this class should only be used for one invocation
of the command. Don't call this method twice on an instance.
call
in interface java.util.concurrent.Callable<java.util.List<DiffEntry>>
call
in class GitCommand<java.util.List<DiffEntry>>
GitAPIException
public DiffCommand setCached(boolean cached)
cached
- whether to view the changes staged for the next commitpublic DiffCommand setPathFilter(TreeFilter pathFilter)
pathFilter
- parameter, used to limit the diff to the named pathpublic DiffCommand setOldTree(AbstractTreeIterator oldTree)
oldTree
- the previous statepublic DiffCommand setNewTree(AbstractTreeIterator newTree)
newTree
- the updated statepublic DiffCommand setShowNameAndStatusOnly(boolean showNameAndStatusOnly)
showNameAndStatusOnly
- whether to return only names and status of changed filespublic DiffCommand setOutputStream(java.io.OutputStream out)
out
- the stream to write line datapublic DiffCommand setContextLines(int contextLines)
contextLines
- the number of context linespublic DiffCommand setSourcePrefix(java.lang.String sourcePrefix)
sourcePrefix
- the prefixpublic DiffCommand setDestinationPrefix(java.lang.String destinationPrefix)
destinationPrefix
- the prefixpublic DiffCommand setProgressMonitor(ProgressMonitor monitor)
NullProgressMonitor
monitor
- a progress monitorNullProgressMonitor