diff --git a/models/repo.go b/models/repo.go
index 01b8fdb12..01736b631 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -255,12 +255,13 @@ func CreateRepository(user *User, name, desc, lang, license string, private, mir
}
repo := &Repository{
- OwnerId: user.Id,
- Name: name,
- LowerName: strings.ToLower(name),
- Description: desc,
- IsPrivate: private,
- IsBare: lang == "" && license == "" && !initReadme,
+ OwnerId: user.Id,
+ Name: name,
+ LowerName: strings.ToLower(name),
+ Description: desc,
+ IsPrivate: private,
+ IsBare: lang == "" && license == "" && !initReadme,
+ DefaultBranch: "master",
}
repoPath := RepoPath(user.Name, repo.Name)
diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go
index c8e1aaee7..cd13d4ef4 100644
--- a/modules/middleware/repo.go
+++ b/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:
diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl
index 648eb7c46..441fd542d 100644
--- a/templates/base/head.tmpl
+++ b/templates/base/head.tmpl
@@ -9,7 +9,7 @@
- {{if .Repository.IsGoget}}{{end}}
+
{{if IsProdMode}}