mirror of
https://github.com/go-gitea/gitea
synced 2025-08-04 16:48:37 +00:00
update with git api
This commit is contained in:
@@ -140,8 +140,7 @@ func ReleasesNewPost(ctx *middleware.Context, form auth.NewReleaseForm) {
|
||||
IsPrerelease: form.Prerelease,
|
||||
}
|
||||
|
||||
if err = models.CreateRelease(models.RepoPath(ctx.User.Name, ctx.Repo.Repository.Name),
|
||||
rel, ctx.Repo.GitRepo); err != nil {
|
||||
if err = models.CreateRelease(ctx.Repo.GitRepo, rel); err != nil {
|
||||
if err == models.ErrReleaseAlreadyExist {
|
||||
ctx.RenderWithErr("Release with this tag name has already existed", "release/new", &form)
|
||||
} else {
|
||||
|
@@ -10,8 +10,6 @@ import (
|
||||
|
||||
"github.com/go-martini/martini"
|
||||
|
||||
"github.com/gogits/git"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/auth"
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
@@ -57,7 +55,7 @@ func SettingPost(ctx *middleware.Context, form auth.RepoSettingForm) {
|
||||
|
||||
br := form.Branch
|
||||
|
||||
if git.IsBranchExist(models.RepoPath(ctx.User.Name, ctx.Repo.Repository.Name), br) {
|
||||
if ctx.Repo.GitRepo.IsBranchExist(br) {
|
||||
ctx.Repo.Repository.DefaultBranch = br
|
||||
}
|
||||
ctx.Repo.Repository.Description = form.Description
|
||||
|
Reference in New Issue
Block a user