mirror of
1
Fork 0
This commit is contained in:
Unknown 2014-04-13 04:08:25 -04:00
parent 9d983f27d6
commit d26a333dfb
3 changed files with 12 additions and 7 deletions

View File

@ -255,12 +255,13 @@ func CreateRepository(user *User, name, desc, lang, license string, private, mir
} }
repo := &Repository{ repo := &Repository{
OwnerId: user.Id, OwnerId: user.Id,
Name: name, Name: name,
LowerName: strings.ToLower(name), LowerName: strings.ToLower(name),
Description: desc, Description: desc,
IsPrivate: private, IsPrivate: private,
IsBare: lang == "" && license == "" && !initReadme, IsBare: lang == "" && license == "" && !initReadme,
DefaultBranch: "master",
} }
repoPath := RepoPath(user.Name, repo.Name) repoPath := RepoPath(user.Name, repo.Name)

View File

@ -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.Repo.CloneLink.HTTPS = fmt.Sprintf("%s%s/%s.git", base.AppUrl, user.LowerName, repo.LowerName)
ctx.Data["CloneLink"] = ctx.Repo.CloneLink 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 // when repo is bare, not valid branch
if !ctx.Repo.Repository.IsBare && validBranch { if !ctx.Repo.Repository.IsBare && validBranch {
detect: detect:

View File

@ -9,7 +9,7 @@
<meta name="description" content="Gogs(Go Git Service) is a GitHub-like clone in the Go Programming Language" /> <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="keywords" content="go, git">
<meta name="_csrf" content="{{.CsrfToken}}" /> <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 --> <!-- Stylesheets -->
{{if IsProdMode}} {{if IsProdMode}}