Class CustomDiffCommand
- java.lang.Object
-
- org.eclipse.jgit.api.GitCommand<List<org.eclipse.jgit.diff.DiffEntry>>
-
- org.uberfire.java.nio.fs.jgit.util.commands.CustomDiffCommand
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCustomDiffCommand(Git git)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<org.eclipse.jgit.diff.DiffEntry>call()Executes theDiffcommand with all the options and parameters collected by the setter methods (e.g.CustomDiffCommandsetCached(boolean cached)CustomDiffCommandsetContextLines(int contextLines)Set number of context lines instead of the usual three.CustomDiffCommandsetDestinationPrefix(String destinationPrefix)Set the given destination prefix instead of "b/".CustomDiffCommandsetNewTree(org.eclipse.jgit.treewalk.AbstractTreeIterator newTree)CustomDiffCommandsetOldTree(org.eclipse.jgit.treewalk.AbstractTreeIterator oldTree)CustomDiffCommandsetOutputStream(OutputStream out)CustomDiffCommandsetPathFilter(org.eclipse.jgit.treewalk.filter.TreeFilter pathFilter)CustomDiffCommandsetProgressMonitor(org.eclipse.jgit.lib.ProgressMonitor monitor)The progress monitor associated with the diff operation.CustomDiffCommandsetShowNameAndStatusOnly(boolean showNameAndStatusOnly)CustomDiffCommandsetSourcePrefix(String sourcePrefix)Set the given source prefix instead of "a/".
-
-
-
Constructor Detail
-
CustomDiffCommand
protected CustomDiffCommand(Git git)
- Parameters:
repo-
-
-
Method Detail
-
call
public List<org.eclipse.jgit.diff.DiffEntry> call() throws org.eclipse.jgit.api.errors.GitAPIException
Executes theDiffcommand 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.
-
setCached
public CustomDiffCommand setCached(boolean cached)
- Parameters:
cached- whether to view the changes you staged for the next commit- Returns:
- this instance
-
setPathFilter
public CustomDiffCommand setPathFilter(org.eclipse.jgit.treewalk.filter.TreeFilter pathFilter)
- Parameters:
pathFilter- parameter, used to limit the diff to the named path- Returns:
- this instance
-
setOldTree
public CustomDiffCommand setOldTree(org.eclipse.jgit.treewalk.AbstractTreeIterator oldTree)
- Parameters:
oldTree- the previous state- Returns:
- this instance
-
setNewTree
public CustomDiffCommand setNewTree(org.eclipse.jgit.treewalk.AbstractTreeIterator newTree)
- Parameters:
newTree- the updated state- Returns:
- this instance
-
setShowNameAndStatusOnly
public CustomDiffCommand setShowNameAndStatusOnly(boolean showNameAndStatusOnly)
- Parameters:
showNameAndStatusOnly- whether to return only names and status of changed files- Returns:
- this instance
-
setOutputStream
public CustomDiffCommand setOutputStream(OutputStream out)
- Parameters:
out- the stream to write line data- Returns:
- this instance
-
setContextLines
public CustomDiffCommand setContextLines(int contextLines)
Set number of context lines instead of the usual three.- Parameters:
contextLines- the number of context lines- Returns:
- this instance
-
setSourcePrefix
public CustomDiffCommand setSourcePrefix(String sourcePrefix)
Set the given source prefix instead of "a/".- Parameters:
sourcePrefix- the prefix- Returns:
- this instance
-
setDestinationPrefix
public CustomDiffCommand setDestinationPrefix(String destinationPrefix)
Set the given destination prefix instead of "b/".- Parameters:
destinationPrefix- the prefix- Returns:
- this instance
-
setProgressMonitor
public CustomDiffCommand setProgressMonitor(org.eclipse.jgit.lib.ProgressMonitor monitor)
The progress monitor associated with the diff operation. By default, this is set toNullProgressMonitor- Parameters:
monitor- a progress monitor- Returns:
- this instance
- See Also:
NullProgressMonitor
-
-