Prechádzať zdrojové kódy

Merge pull request #1820 from infosiftr/auto-upgrade-git-colon

Auto-upgrade "git://github.com/..." to "https://github.com/..." (with a warning)
yosifkit 9 rokov pred
rodič
commit
2e4c0fe7e0
1 zmenil súbory, kde vykonal 5 pridanie a 0 odobranie
  1. 5 0
      bashbrew/go/src/bashbrew/git.go

+ 5 - 0
bashbrew/go/src/bashbrew/git.go

@@ -125,6 +125,11 @@ func (r Repo) fetchGitRepo(entry *manifest.Manifest2822Entry) (string, error) {
 		// we create a temporary remote dir so that we can clean it up completely afterwards
 	}
 
+	if strings.HasPrefix(entry.GitRepo, "git://github.com/") {
+		fmt.Fprintf(os.Stderr, "warning: insecure protocol git:// detected: %s\n", entry.GitRepo)
+		entry.GitRepo = strings.Replace(entry.GitRepo, "git://", "https://", 1)
+	}
+
 	_, err = git("fetch", "--quiet", "--no-tags", entry.GitRepo, fetchString)
 	if err != nil {
 		return "", err