Skip to content

Commit

Permalink
Merge pull request #663 from bmeneguele/fix-maplabels
Browse files Browse the repository at this point in the history
labels: don't fetch labels in case of empty request
  • Loading branch information
bmeneg committed Apr 9, 2021
2 parents 84599aa + 898dff8 commit e735c02
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/label_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ lab label list remote "search term" # search "remote" for labels with "search t
}

func MapLabels(rn string, labelTerms []string) ([]string, error) {
// Don't bother fetching project labels if nothing is being really requested
if len(labelTerms) == 0 {
return []string{}, nil
}

labels, err := lab.LabelList(rn)
if err != nil {
return nil, err
Expand Down

0 comments on commit e735c02

Please sign in to comment.