Skip to content

Commit

Permalink
list: Fix list user options
Browse files Browse the repository at this point in the history
The "--assignee", "--reviewer", and "--author" options are not working
because the scope of the variables was incorrect.

Fix thhe "--assignee", "--reviewer", and "--author" list command options.

Signed-off-by: Prarit Bhargava <[email protected]>
Signed-off-by: Bruno Meneguele <[email protected]>
  • Loading branch information
prarit committed Apr 14, 2021
1 parent ee1444e commit efec805
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cmd/issue_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ func issueList(args []string) ([]*gitlab.Issue, error) {
// because of that we need to get user's ID for both assignee and
// author.
if issueAuthor != "" {
issueAuthorID := getUserID(issueAuthor)
issueAuthorID = getUserID(issueAuthor)
if issueAuthorID == nil {
log.Fatal(fmt.Errorf("%s user not found\n", issueAuthor))
}
}

if issueAssignee != "" {
issueAssigneeID := getUserID(issueAssignee)
issueAssigneeID = getUserID(issueAssignee)
if issueAssigneeID == nil {
log.Fatal(fmt.Errorf("%s user not found\n", issueAssignee))
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/mr_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func mrList(args []string) ([]*gitlab.MergeRequest, error) {
// gitlab lib still doesn't have search by assignee and author username
// for merge requests, because of that we need to get the ID for both.
if mrAssignee != "" {
mrAssigneeID := getUserID(mrAssignee)
mrAssigneeID = getUserID(mrAssignee)
if mrAssigneeID == nil {
log.Fatal(fmt.Errorf("%s user not found\n", mrAssignee))
}
Expand All @@ -95,7 +95,7 @@ func mrList(args []string) ([]*gitlab.MergeRequest, error) {
}

if mrAuthor != "" {
mrAuthorID := getUserID(mrAuthor)
mrAuthorID = getUserID(mrAuthor)
if mrAuthorID == nil {
log.Fatal(fmt.Errorf("%s user not found\n", mrAuthor))
}
Expand All @@ -110,7 +110,7 @@ func mrList(args []string) ([]*gitlab.MergeRequest, error) {
}

if mrReviewer != "" {
mrReviewerID := getUserID(mrReviewer)
mrReviewerID = getUserID(mrReviewer)
if mrReviewerID == nil {
log.Fatal(fmt.Errorf("%s user not found\n", mrReviewer))
}
Expand Down

0 comments on commit efec805

Please sign in to comment.