瀏覽代碼

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

Auto-upgrade "git://github.com/..." to "https://github.com/..." (with a warning)
yosifkit 9 年之前
父節點
當前提交
2e4c0fe7e0
共有 1 個文件被更改,包括 5 次插入0 次删除
  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