Skip to content

Commit ed3308a

Browse files
committed
chore: remove unnecessary normalization
1 parent 39f8935 commit ed3308a

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

  • services/apps/git_integration/src/crowdgit/services/vulnerability_scanner

services/apps/git_integration/src/crowdgit/services/vulnerability_scanner/config.go

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"fmt"
55
"os"
66
"strconv"
7-
"strings"
87
)
98

109
type DBConfig struct {
@@ -27,7 +26,7 @@ func getConfig(targetPath, gitURL string) (Config, error) {
2726
var config Config
2827

2928
config.TargetPath = targetPath
30-
config.GitURL = normalizeGitURL(gitURL)
29+
config.GitURL = gitURL
3130

3231
if _, err := os.Stat(config.TargetPath); os.IsNotExist(err) {
3332
return config, fmt.Errorf("target path '%s' does not exist: %w", config.TargetPath, err)
@@ -53,16 +52,3 @@ func getConfig(targetPath, gitURL string) (Config, error) {
5352

5453
return config, nil
5554
}
56-
57-
func normalizeGitURL(gitURL string) string {
58-
switch {
59-
case strings.HasPrefix(gitURL, "ssh://git@"):
60-
return strings.Replace(gitURL, "ssh://git@", "https://", 1)
61-
case strings.HasPrefix(gitURL, "http://"):
62-
return strings.Replace(gitURL, "http://", "https://", 1)
63-
case strings.HasPrefix(gitURL, "git@"):
64-
gitURL = strings.Replace(gitURL, ":", "/", 1)
65-
return strings.Replace(gitURL, "git@", "https://", 1)
66-
}
67-
return gitURL
68-
}

0 commit comments

Comments
 (0)