Add whitespace_only flag to CommitDiff RPC

Right now GitLab uses DiffStats RPC to determine if a particular diff file contains only whitespace changes. This is possible because of the following:

  1. Whitespace only diff files are sent with empty patch data from Gitaly
  2. DiffStats RPC contains the actual line count of the diff

By comparing these two data points we can infer that the diff was indeed collapsed due to whitespace changes.

However this is very inefficient because:

  1. Gitaly already does the heavy-lifting for detecting such files
  2. Sending additional DiffStats RPC is expensive

To solve this problem we could have a whitespace_only flag added to CommitDiffResponse.

Assignee Loading
Time tracking Loading