Resolve lint for unused parameter and unnecessary type arguments (#30750)

Resolve all cases for `unused parameter` and `unnecessary type
arguments`

Related: #30729

---------

Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit e80466f7349164ce4cf3c07bdac30d736d20f035)

Conflicts:
	modules/markup/markdown/transform_codespan.go
	modules/setting/incoming_email.go
	routers/api/v1/admin/user_badge.go
	routers/private/hook_pre_receive.go
	tests/integration/repo_search_test.go
	resolved by discarding the change, this is linting only and
	for the sake of avoiding future conflicts
This commit is contained in:
Chongyi Zheng 2024-04-29 04:47:56 -04:00 committed by Earl Warren
parent b8e7b3941a
commit c504461b66
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
41 changed files with 107 additions and 129 deletions

View file

@ -62,8 +62,8 @@ func isIndexable(entry *git.TreeEntry) bool {
}
// parseGitLsTreeOutput parses the output of a `git ls-tree -r --full-name` command
func parseGitLsTreeOutput(objectFormat git.ObjectFormat, stdout []byte) ([]internal.FileUpdate, error) {
entries, err := git.ParseTreeEntries(objectFormat, stdout)
func parseGitLsTreeOutput(stdout []byte) ([]internal.FileUpdate, error) {
entries, err := git.ParseTreeEntries(stdout)
if err != nil {
return nil, err
}
@ -91,10 +91,8 @@ func genesisChanges(ctx context.Context, repo *repo_model.Repository, revision s
return nil, runErr
}
objectFormat := git.ObjectFormatFromName(repo.ObjectFormatName)
var err error
changes.Updates, err = parseGitLsTreeOutput(objectFormat, stdout)
changes.Updates, err = parseGitLsTreeOutput(stdout)
return &changes, err
}
@ -172,8 +170,6 @@ func nonGenesisChanges(ctx context.Context, repo *repo_model.Repository, revisio
return nil, err
}
objectFormat := git.ObjectFormatFromName(repo.ObjectFormatName)
changes.Updates, err = parseGitLsTreeOutput(objectFormat, lsTreeStdout)
changes.Updates, err = parseGitLsTreeOutput(lsTreeStdout)
return &changes, err
}