Interface GitDiffBuilder

All Superinterfaces:
com.atlassian.bitbucket.scm.CommandBuilderSupport<GitDiffBuilder>, GitCommandBuilderSupport<GitDiffBuilder>, GitDiffCoreBuilder<GitDiffBuilder>

public interface GitDiffBuilder extends GitDiffCoreBuilder<GitDiffBuilder>
Extends the diff-core builder with options specific to git diff.
  • Method Details

    • contextLines

      @Nonnull GitDiffBuilder contextLines(int value)
      Sets the number of context lines which should be included in the git diff output. By default, git uses 3 lines. The provided value 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 provided value is negative
      See Also:
    • defaultContextLines

      @Nonnull GitDiffBuilder defaultContextLines()
      Restores the default number of context lines.
      Returns:
      this
      See Also:
    • dstPrefix

      @Nonnull GitDiffBuilder dstPrefix(@Nullable String value)
      Sets the prefix to be used by git when outputing the destination path in a diff header. The default used by git is "b/".
      
           diff --git a/file.txt b/file.txt
           index 05feec6..898a7b8 100644
           --- a/file.txt
           +++ b/file.txt
       
      Changing this value controls both the b/file.txt in the diff --git header and the +++ path after the index details.
      Parameters:
      value - the prefix to display before the destination path, may be empty or null to use the default
      Returns:
      this
    • srcPrefix

      @Nonnull GitDiffBuilder srcPrefix(@Nullable String value)
      Sets the prefix to be used by git when outputing the source path in a diff header. The default used by git is "a/".
      
           diff --git a/file.txt b/file.txt
           index 05feec6..898a7b8 100644
           --- a/file.txt
           +++ b/file.txt
       
      Changing this value controls both the a/file.txt in the diff --git header and the --- path after the index details.
      Parameters:
      value - the prefix to display before the source path, may be empty or null to use the default
      Returns:
      this
    • whitespace

      @Nonnull GitDiffBuilder whitespace(@Nonnull GitDiffWhitespace value)
      Parameters:
      value - an optional flag to ignore whitespace in the diff
      Returns:
      this
      Throws:
      NullPointerException - if the provided value is null