Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
attiasas committed Dec 18, 2024
1 parent 6f3682e commit 30b7610
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
8 changes: 2 additions & 6 deletions xray/services/utils/watchbody.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,12 @@ func CreateBody(params WatchParams) (*WatchBody, error) {
return nil, err
}

err = configureGitRepositories(&payloadBody, params)
if err != nil {
return nil, err
}
configureGitRepositories(&payloadBody, params)

return &payloadBody, nil
}

func configureGitRepositories(payloadBody *WatchBody, params WatchParams) error {
func configureGitRepositories(payloadBody *WatchBody, params WatchParams) {
for _, gitRepoResource := range params.GitRepositories.Resources {
gitRepo := watchProjectResourcesElement{
Type: WatchGitRepository,
Expand All @@ -216,7 +213,6 @@ func configureGitRepositories(payloadBody *WatchBody, params WatchParams) error
}
payloadBody.ProjectResources.Resources = append(payloadBody.ProjectResources.Resources, gitRepo)
}
return nil
}

func configureRepositories(payloadBody *WatchBody, params WatchParams) error {
Expand Down
1 change: 1 addition & 0 deletions xsc/services/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func IsXscXrayInnerService(xrayVersion string) bool {
return true
}

// The platform expects the git repo key to be in the format of the https/http clone Git URL without the protocol.
func GetGitRepoUrlKey(gitRepoHttpUrl string) string {
if len(gitRepoHttpUrl) == 0 {
// No git context was provided
Expand Down

0 comments on commit 30b7610

Please sign in to comment.