From 4435d7f2f6ede2c5449b851211c0b7bbcd952009 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Fri, 2 Oct 2015 16:02:37 -0700 Subject: [PATCH] added ssh param to force git+ssh cloning --- remote/github/github.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/remote/github/github.go b/remote/github/github.go index 763000ca7..97d1d66d0 100644 --- a/remote/github/github.go +++ b/remote/github/github.go @@ -32,6 +32,7 @@ type Github struct { Open bool PrivateMode bool SkipVerify bool + GitSSH bool } func Load(env envconfig.Env) *Github { @@ -56,6 +57,7 @@ func Load(env envconfig.Env) *Github { github.PrivateMode, _ = strconv.ParseBool(params.Get("private_mode")) github.SkipVerify, _ = strconv.ParseBool(params.Get("skip_verify")) github.Open, _ = strconv.ParseBool(params.Get("open")) + github.GitSSH, _ = strconv.ParseBool(params.Get("ssh")) if github.URL == DefaultURL { github.API = DefaultAPI @@ -153,6 +155,11 @@ func (g *Github) Repo(u *model.User, owner, name string) (*model.Repo, error) { if g.PrivateMode { repo.IsPrivate = true } + + if g.GitSSH && repo.IsPrivate { + repo.Clone = *repo_.SSHURL + } + return repo, err }