1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Fixed commit count. (#17698)

Added "Tag" label.
Unified branch, tag and commit name.
This commit is contained in:
KN4CK3R
2021-11-18 00:50:17 +01:00
committed by GitHub
parent 3c4724d70e
commit ea42d3c04e
8 changed files with 35 additions and 32 deletions

View File

@@ -344,17 +344,15 @@ func CreateBranch(ctx *context.Context) {
var err error
if form.CreateTag {
if ctx.Repo.IsViewTag {
err = release_service.CreateNewTag(ctx.User, ctx.Repo.Repository, ctx.Repo.CommitID, form.NewBranchName, "")
} else {
err = release_service.CreateNewTag(ctx.User, ctx.Repo.Repository, ctx.Repo.BranchName, form.NewBranchName, "")
target := ctx.Repo.CommitID
if ctx.Repo.IsViewBranch {
target = ctx.Repo.BranchName
}
err = release_service.CreateNewTag(ctx.User, ctx.Repo.Repository, target, form.NewBranchName, "")
} else if ctx.Repo.IsViewBranch {
err = repo_service.CreateNewBranch(ctx.User, ctx.Repo.Repository, ctx.Repo.BranchName, form.NewBranchName)
} else if ctx.Repo.IsViewTag {
err = repo_service.CreateNewBranchFromCommit(ctx.User, ctx.Repo.Repository, ctx.Repo.CommitID, form.NewBranchName)
} else {
err = repo_service.CreateNewBranchFromCommit(ctx.User, ctx.Repo.Repository, ctx.Repo.BranchName, form.NewBranchName)
err = repo_service.CreateNewBranchFromCommit(ctx.User, ctx.Repo.Repository, ctx.Repo.CommitID, form.NewBranchName)
}
if err != nil {
if models.IsErrTagAlreadyExists(err) {