Skip to content

Commit

Permalink
gitlab: remove redundant code for project object
Browse files Browse the repository at this point in the history
In lab.FindProject() the GetProject API is being used in the exact same way the
function lab.GetProject() is using. This patch removes this redundant code
and use the lab.GetProject() function instead.

Signed-off-by: Bruno Meneguele <[email protected]>
  • Loading branch information
bmeneg committed Oct 1, 2021
1 parent fd3d2ce commit c9fde25
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions internal/gitlab/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,7 @@ func FindProject(project string) (*gitlab.Project, error) {
search = user + "/" + project
}

target, resp, err := lab.Projects.GetProject(search, nil)
if resp != nil && resp.StatusCode == http.StatusNotFound {
return nil, ErrProjectNotFound
}
target, err := GetProject(search)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit c9fde25

Please sign in to comment.