From bed693c79acdf001dbce70fe2ea23ee1c071b147 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 7 Jun 2016 16:14:30 -0700 Subject: [PATCH] Auto-upgrade "git://github.com/..." to "https://github.com/..." (with a warning) --- go/src/bashbrew/git.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/go/src/bashbrew/git.go b/go/src/bashbrew/git.go index 997351c..78acfd1 100644 --- a/go/src/bashbrew/git.go +++ b/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