public class DiffCommand extends GitCommand<List<DiffEntry>>
repo
Modifier | Constructor and Description |
---|---|
protected |
DiffCommand(Repository repo) |
Modifier and Type | Method and Description |
---|---|
List<DiffEntry> |
call()
Executes the
Diff command with all the options and parameters
collected by the setter methods (e.g. |
DiffCommand |
setCached(boolean cached) |
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) |
DiffCommand |
setOldTree(AbstractTreeIterator oldTree) |
DiffCommand |
setOutputStream(OutputStream out) |
DiffCommand |
setPathFilter(TreeFilter pathFilter) |
DiffCommand |
setProgressMonitor(ProgressMonitor monitor)
The progress monitor associated with the diff operation.
|
DiffCommand |
setShowNameAndStatusOnly(boolean showNameAndStatusOnly) |
DiffCommand |
setSourcePrefix(String sourcePrefix)
Set the given source prefix instead of "a/".
|
checkCallable, getRepository, setCallable
protected DiffCommand(Repository repo)
repo
- public List<DiffEntry> call() throws GitAPIException
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>>
GitAPIException
- or subclass thereof when an error occurspublic DiffCommand setCached(boolean cached)
cached
- whether to view the changes you 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)
NullProgressMonitor
monitor
- a progress monitorNullProgressMonitor
Copyright © 2018 Eclipse JGit Project. All rights reserved.