Browse Source

go get

pull/77/head
Unknown 11 years ago
parent
commit
d26a333dfb
  1. 1
      models/repo.go
  2. 4
      modules/middleware/repo.go
  3. 2
      templates/base/head.tmpl

1
models/repo.go

@ -261,6 +261,7 @@ func CreateRepository(user *User, name, desc, lang, license string, private, mir
Description: desc,
IsPrivate: private,
IsBare: lang == "" && license == "" && !initReadme,
DefaultBranch: "master",
}
repoPath := RepoPath(user.Name, repo.Name)

4
modules/middleware/repo.go

@ -134,6 +134,10 @@ func RepoAssignment(redirect bool, args ...bool) martini.Handler {
ctx.Repo.CloneLink.HTTPS = fmt.Sprintf("%s%s/%s.git", base.AppUrl, user.LowerName, repo.LowerName)
ctx.Data["CloneLink"] = ctx.Repo.CloneLink
if ctx.Repo.Repository.IsGoget {
ctx.Data["GoGetLink"] = strings.TrimSuffix(ctx.Repo.CloneLink.HTTPS, ".git")
}
// when repo is bare, not valid branch
if !ctx.Repo.Repository.IsBare && validBranch {
detect:

2
templates/base/head.tmpl

@ -9,7 +9,7 @@
<meta name="description" content="Gogs(Go Git Service) is a GitHub-like clone in the Go Programming Language" />
<meta name="keywords" content="go, git">
<meta name="_csrf" content="{{.CsrfToken}}" />
{{if .Repository.IsGoget}}<meta name="go-import" content="{{AppDomain}} git {{.CloneLink.HTTPS}}">{{end}}
<meta name="go-import" content="{{AppDomain}} git {{if .Repository.IsGoget}}{{.GoGetLink}}{{else}}{{AppDomain}}/{{end}}">
<!-- Stylesheets -->
{{if IsProdMode}}

Loading…
Cancel
Save