Interface GitDiffBuilder
- All Superinterfaces:
com.atlassian.bitbucket.scm.CommandBuilderSupport<GitDiffBuilder>
,GitCommandBuilderSupport<GitDiffBuilder>
,GitDiffCoreBuilder<GitDiffBuilder>
Extends the
diff-core builder
with options specific to git diff
.-
Field Summary
Fields inherited from interface com.atlassian.bitbucket.scm.git.command.GitCommandBuilderSupport
ENV_AUTHOR_DATE, ENV_AUTHOR_EMAIL, ENV_AUTHOR_NAME, ENV_COMMITTER_DATE, ENV_COMMITTER_EMAIL, ENV_COMMITTER_NAME
-
Method Summary
Modifier and TypeMethodDescriptioncontextLines
(int value) Sets the number of context lines which should be included in thegit diff
output.Restores the default number of context lines.Sets the prefix to be used by git when outputing the destination path in a diff header.Sets the prefix to be used by git when outputing the source path in a diff header.whitespace
(GitDiffWhitespace value) Methods inherited from interface com.atlassian.bitbucket.scm.CommandBuilderSupport
clearEnvironment, defaultExitHandler, exitHandler, removeEnvironment, withEnvironment
Methods inherited from interface com.atlassian.bitbucket.scm.git.command.GitCommandBuilderSupport
alternate, alternates, alternates, author, author, author, build, commitish, committer, committer, committer, treeish, withConfiguration, withConfiguration, withConfiguration, withConfiguration
-
Method Details
-
contextLines
Sets the number of context lines which should be included in thegit diff
output. By default, git uses 3 lines. The providedvalue
must be greater than or equal to 0, since a negative number of context lines has no meaning.defaultContextLines()
can be called to restore the default after using a custom value.- Parameters:
value
- the number of context lines to include in the diff output,0
or higher- Returns:
this
- Throws:
IllegalArgumentException
- if the providedvalue
is negative- See Also:
-
defaultContextLines
Restores the default number of context lines.- Returns:
this
- See Also:
-
dstPrefix
Sets the prefix to be used by git when outputing the destination path in a diff header. The default used by git is"b/"
.
Changing this value controls both thediff --git a/file.txt b/file.txt index 05feec6..898a7b8 100644 --- a/file.txt +++ b/file.txt
b/file.txt
in thediff --git
header and the+++
path after the index details.- Parameters:
value
- the prefix to display before the destination path, may be empty ornull
to use the default- Returns:
this
-
srcPrefix
Sets the prefix to be used by git when outputing the source path in a diff header. The default used by git is"a/"
.
Changing this value controls both thediff --git a/file.txt b/file.txt index 05feec6..898a7b8 100644 --- a/file.txt +++ b/file.txt
a/file.txt
in thediff --git
header and the---
path after the index details.- Parameters:
value
- the prefix to display before the source path, may be empty ornull
to use the default- Returns:
this
-
whitespace
- Parameters:
value
- an optional flag to ignore whitespace in the diff- Returns:
this
- Throws:
NullPointerException
- if the providedvalue
isnull
-