public class DiffCommand extends GitCommand<List<DiffEntry>>
repo| Modifier | Constructor and Description |
|---|---|
protected |
DiffCommand(Repository repo)
Constructor for DiffCommand
|
| Modifier and Type | Method and Description |
|---|---|
List<DiffEntry> |
call() |
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(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(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(String sourcePrefix)
Set the given source prefix instead of "a/".
|
checkCallable, getRepository, setCallableprotected DiffCommand(Repository repo)
repo - a Repository object.public 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 Callable<List<DiffEntry>>call in class GitCommand<List<DiffEntry>>GitAPIExceptionpublic 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(OutputStream out)
out - the stream to write line datapublic DiffCommand setContextLines(int contextLines)
contextLines - the number of context linespublic DiffCommand setSourcePrefix(String sourcePrefix)
sourcePrefix - the prefixpublic DiffCommand setDestinationPrefix(String destinationPrefix)
destinationPrefix - the prefixpublic DiffCommand setProgressMonitor(ProgressMonitor monitor)
NullProgressMonitormonitor - a progress monitorNullProgressMonitorCopyright © 2018 Eclipse JGit Project. All rights reserved.