mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-26 06:16:56 +09:00
enable staticcheck QFxxxx rules (#34064)
This commit is contained in:
1 parent
5564c39105
commit
2a59dfbd47
47 files changed
+179
-143
No files matched your search
@@ -19,11 +19,12 @@ func (repo *Repository) GetRefs() ([]*Reference, error) {
|
||||
// refType should only be a literal "branch" or "tag" and nothing else
|
||||
func (repo *Repository) ListOccurrences(ctx context.Context, refType, commitSHA string) ([]string, error) {
|
||||
cmd := NewCommand()
|
||||
if refType == "branch" {
|
||||
switch refType {
|
||||
case "branch":
|
||||
cmd.AddArguments("branch")
|
||||
} else if refType == "tag" {
|
||||
case "tag":
|
||||
cmd.AddArguments("tag")
|
||||
} else {
|
||||
default:
|
||||
return nil, util.NewInvalidArgumentErrorf(`can only use "branch" or "tag" for refType, but got %q`, refType)
|
||||
}
|
||||
stdout, _, err := cmd.AddArguments("--no-color", "--sort=-creatordate", "--contains").AddDynamicArguments(commitSHA).RunStdString(ctx, &RunOpts{Dir: repo.Path})
|
||||
|
||||
Reference in new issue
Block a user