mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-05-31 15:21:00 +08:00
enable staticcheck QFxxxx rules (#34064)
This commit is contained in:
@ -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