Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-10916

Diff command fails if DiffContext.maxLineLength is not set

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • None
    • None
    • None

      Steps to reproduce

      1. Create a DiffContext using DiffContext.Builder and don't set a maxLineLength (or set it to something short).
      2. Call a a diff command using that diff context

      Expected result:

      Diff is streamed into callback like normal

      Actual result:

      DiffOutputHandler fails reading the hunk header because the max line length is too short.

      Example:

      scmService.getPullRequestCommandFactory(pullRequest)
              .diff(new PullRequestDiffCommandParameters.Builder().maxLineLength(0).build(), new AbstractDiffContentCallback(){});
      

      Workaround

      Set the maxLine length to something long enough to read the header hunks

              jpalacios Juan Palacios (Inactive)
              khughes@atlassian.com Kristy
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: