diff options
Diffstat (limited to 'routers/repo/pull.go')
-rw-r--r-- | routers/repo/pull.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/routers/repo/pull.go b/routers/repo/pull.go index 6a1aaf314d..57fe33f855 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -390,6 +390,12 @@ func ViewPullFiles(ctx *context.Context) { } pull := issue.PullRequest + whitespaceFlags := map[string]string{ + "ignore-all": "-w", + "ignore-change": "-b", + "ignore-eol": "--ignore-space-at-eol", + "": ""} + var ( diffRepoPath string startCommitID string @@ -455,11 +461,12 @@ func ViewPullFiles(ctx *context.Context) { ctx.Data["Reponame"] = pull.HeadRepo.Name } - diff, err := models.GetDiffRange(diffRepoPath, + diff, err := models.GetDiffRangeWithWhitespaceBehavior(diffRepoPath, startCommitID, endCommitID, setting.Git.MaxGitDiffLines, - setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles) + setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles, + whitespaceFlags[ctx.Data["WhitespaceBehavior"].(string)]) if err != nil { - ctx.ServerError("GetDiffRange", err) + ctx.ServerError("GetDiffRangeWithWhitespaceBehavior", err) return } |