From 4c1452574a14737b52b13ee2726fb5dd53f56cc1 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sun, 13 Apr 2014 05:02:11 -0400 Subject: [PATCH] go get --- modules/base/template.go | 12 ------------ modules/middleware/repo.go | 3 ++- routers/dashboard.go | 5 ----- routers/repo/repo.go | 4 ---- templates/base/head.tmpl | 2 +- 5 files changed, 3 insertions(+), 23 deletions(-) diff --git a/modules/base/template.go b/modules/base/template.go index 863bd89e810..62414979697 100644 --- a/modules/base/template.go +++ b/modules/base/template.go @@ -197,15 +197,3 @@ func DiffLineTypeToStr(diffType int) string { } return "same" } - -const ( - TPL_GO_GET_META = `` -) - -func GetGoGetMetaList() []byte { - buf := bytes.NewBuffer([]byte("")) - for meta := range GoGetMetas { - buf.WriteString(fmt.Sprintf(TPL_GO_GET_META, Domain, meta)) - } - return buf.Bytes() -} diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go index cd13d4ef492..1e79ce9870e 100644 --- a/modules/middleware/repo.go +++ b/modules/middleware/repo.go @@ -135,7 +135,8 @@ func RepoAssignment(redirect bool, args ...bool) martini.Handler { ctx.Data["CloneLink"] = ctx.Repo.CloneLink if ctx.Repo.Repository.IsGoget { - ctx.Data["GoGetLink"] = strings.TrimSuffix(ctx.Repo.CloneLink.HTTPS, ".git") + ctx.Data["GoGetLink"] = fmt.Sprintf("%s%s/%s", base.AppUrl, user.LowerName, repo.LowerName) + ctx.Data["GoGetImport"] = fmt.Sprintf("%s/%s/%s", base.Domain, user.LowerName, repo.LowerName) } // when repo is bare, not valid branch diff --git a/routers/dashboard.go b/routers/dashboard.go index 12635412ad3..2c81cf23c17 100644 --- a/routers/dashboard.go +++ b/routers/dashboard.go @@ -11,11 +11,6 @@ import ( ) func Home(ctx *middleware.Context) { - if ctx.Query("go-get") == "1" { - ctx.Write(base.GetGoGetMetaList()) - return - } - if ctx.IsSigned { user.Dashboard(ctx) return diff --git a/routers/repo/repo.go b/routers/repo/repo.go index a7088d5552e..dda26899d0b 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -107,10 +107,6 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) { } func Single(ctx *middleware.Context, params martini.Params) { - if ctx.Query("go-get") == "1" { - base.GoGetMetas[strings.TrimSuffix(ctx.Repo.CloneLink.HTTPS, ".git")] = true - } - branchName := ctx.Repo.BranchName userName := ctx.Repo.Owner.Name repoName := ctx.Repo.Repository.Name diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index 1d63b466344..0c18c8083cc 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -9,7 +9,7 @@ - + {{if .Repository.IsGoget}}{{end}} {{if IsProdMode}}