summaryrefslogtreecommitdiffstats
path: root/services/gitdiff
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2023-04-22 20:53:00 +0200
committerGitHub <noreply@github.com>2023-04-22 14:53:00 -0400
commit8dc6eabbc02ef07c76671d53f28baf46871d5b68 (patch)
tree52e8a1a59e88fc55c76e2adb82e844caae04a970 /services/gitdiff
parent88201914767e15a51c910d295647d97973fa09bf (diff)
downloadgitea-8dc6eabbc02ef07c76671d53f28baf46871d5b68.tar.gz
gitea-8dc6eabbc02ef07c76671d53f28baf46871d5b68.zip
Update go tool dependencies, restructure lint targets (#24239)
- Update all tool dependencies to latest tag - Remove unused errcheck, it is part of golangci-lint - Include main.go in air - Enable wastedassign again now that it's [generics-compatible](https://github.com/golangci/golangci-lint/pull/3689) - Restructured lint targets to new `lint-*` namespace
Diffstat (limited to 'services/gitdiff')
-rw-r--r--services/gitdiff/gitdiff_test.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/services/gitdiff/gitdiff_test.go b/services/gitdiff/gitdiff_test.go
index eb9ed862e8..389f787dfc 100644
--- a/services/gitdiff/gitdiff_test.go
+++ b/services/gitdiff/gitdiff_test.go
@@ -520,7 +520,7 @@ index 0000000..6bb8f39
Docker Pulls
+ cut off
+ cut off`
- result, err = ParsePatch(setting.Git.MaxGitDiffLines, setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles, strings.NewReader(diff), "")
+ _, err = ParsePatch(setting.Git.MaxGitDiffLines, setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles, strings.NewReader(diff), "")
if err != nil {
t.Errorf("ParsePatch failed: %s", err)
}
@@ -536,11 +536,10 @@ index 0000000..6bb8f39
Docker Pulls
+ cut off
+ cut off`
- result, err = ParsePatch(setting.Git.MaxGitDiffLines, setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles, strings.NewReader(diff2), "")
+ _, err = ParsePatch(setting.Git.MaxGitDiffLines, setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles, strings.NewReader(diff2), "")
if err != nil {
t.Errorf("ParsePatch failed: %s", err)
}
- println(result)
diff2a := `diff --git "a/A \\ B" b/A/B
--- "a/A \\ B"
@@ -553,11 +552,10 @@ index 0000000..6bb8f39
Docker Pulls
+ cut off
+ cut off`
- result, err = ParsePatch(setting.Git.MaxGitDiffLines, setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles, strings.NewReader(diff2a), "")
+ _, err = ParsePatch(setting.Git.MaxGitDiffLines, setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles, strings.NewReader(diff2a), "")
if err != nil {
t.Errorf("ParsePatch failed: %s", err)
}
- println(result)
diff3 := `diff --git a/README.md b/README.md
--- a/README.md
@@ -570,11 +568,10 @@ index 0000000..6bb8f39
Docker Pulls
+ cut off
+ cut off`
- result, err = ParsePatch(setting.Git.MaxGitDiffLines, setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles, strings.NewReader(diff3), "")
+ _, err = ParsePatch(setting.Git.MaxGitDiffLines, setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles, strings.NewReader(diff3), "")
if err != nil {
t.Errorf("ParsePatch failed: %s", err)
}
- println(result)
}
func setupDefaultDiff() *Diff {