Skip to content

Commit

Permalink
Fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 committed Mar 21, 2024
1 parent 1dc2069 commit 9b390c6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions internal/handlers/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,21 +118,21 @@ func inputDescriptorsOf(event deployevent.Event) (result []string) {
// but sometimes is nonsensical without context (e.g. `qa-de-1.git` for a
// checkout of `secrets.git` with path filter on qa-de-1 values), so we're
// only using it if we don't have a better alternative
readableName := name

if repo.RemoteURL != "" {
// our preference is to take the basename from the remote URL, e.g.
// remoteURL = "https://github.com/sapcc/helm-charts/"
// -> readableName = "helm-charts.git"
// remoteURL = "https://github.com/sapcc/helm-charts/"
// -> name = "helm-charts.git"
remoteURL, err := url.Parse(repo.RemoteURL)
if err == nil {
readableName = strings.TrimSuffix(path.Base(strings.TrimSuffix(remoteURL.Path, "/")), ".git")
name = strings.TrimSuffix(path.Base(strings.TrimSuffix(remoteURL.Path, "/")), ".git")
}
}
if !strings.HasSuffix(readableName, ".git") {
readableName += ".git"
if !strings.HasSuffix(name, ".git") {
name += ".git"
}

gitVersions = append(gitVersions, fmt.Sprintf("%s %s", readableName, repo.CommitID))
gitVersions = append(gitVersions, fmt.Sprintf("%s %s", name, repo.CommitID))
}
sort.Strings(gitVersions) // for test reproducability

Expand Down

0 comments on commit 9b390c6

Please sign in to comment.