diff options
Diffstat (limited to 'routers/repo/pull.go')
-rw-r--r-- | routers/repo/pull.go | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/routers/repo/pull.go b/routers/repo/pull.go index 6986002102..d3dd9e4fb5 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -581,12 +581,6 @@ 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 @@ -629,7 +623,7 @@ func ViewPullFiles(ctx *context.Context) { diff, err := gitdiff.GetDiffRangeWithWhitespaceBehavior(diffRepoPath, startCommitID, endCommitID, setting.Git.MaxGitDiffLines, setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles, - whitespaceFlags[ctx.Data["WhitespaceBehavior"].(string)]) + gitdiff.GetWhitespaceFlag(ctx.Data["WhitespaceBehavior"].(string))) if err != nil { ctx.ServerError("GetDiffRangeWithWhitespaceBehavior", err) return @@ -993,7 +987,8 @@ func CompareAndPullRequestPost(ctx *context.Context) { // This stage is already stop creating new pull request, so it does not matter if it has // something to compare or not. - PrepareCompareDiff(ctx, headUser, headRepo, headGitRepo, prInfo, baseBranch, headBranch) + PrepareCompareDiff(ctx, headUser, headRepo, headGitRepo, prInfo, baseBranch, headBranch, + gitdiff.GetWhitespaceFlag(ctx.Data["WhitespaceBehavior"].(string))) if ctx.Written() { return } @@ -1003,7 +998,8 @@ func CompareAndPullRequestPost(ctx *context.Context) { } if util.IsEmptyString(form.Title) { - PrepareCompareDiff(ctx, headUser, headRepo, headGitRepo, prInfo, baseBranch, headBranch) + PrepareCompareDiff(ctx, headUser, headRepo, headGitRepo, prInfo, baseBranch, headBranch, + gitdiff.GetWhitespaceFlag(ctx.Data["WhitespaceBehavior"].(string))) if ctx.Written() { return } |