Whitespace in commits (#14650)

* Add whitespace to commit view

* Add whitespace to /compare/a...b

* Move repeated whitespaceFlags to gitdiff

* Add whitespace for wiki pages
This commit is contained in:
vnkmpf 2021-02-13 05:35:43 +01:00 committed by GitHub
parent a3cc842e15
commit 487f2ee41c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 41 additions and 32 deletions

View file

@ -304,11 +304,12 @@ func Diff(ctx *context.Context) {
ctx.Data["CommitStatus"] = models.CalcCommitStatus(statuses)
ctx.Data["CommitStatuses"] = statuses
diff, err := gitdiff.GetDiffCommit(repoPath,
diff, err := gitdiff.GetDiffCommitWithWhitespaceBehavior(repoPath,
commitID, setting.Git.MaxGitDiffLines,
setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles)
setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles,
gitdiff.GetWhitespaceFlag(ctx.Data["WhitespaceBehavior"].(string)))
if err != nil {
ctx.NotFound("GetDiffCommit", err)
ctx.NotFound("GetDiffCommitWithWhitespaceBehavior", err)
return
}