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

Simplify context ref name (#33267)

This commit is contained in:
wxiaoguang
2025-01-15 11:15:47 +08:00
committed by GitHub
parent cbf933eb4e
commit fcd096231a
12 changed files with 27 additions and 80 deletions

View File

@@ -193,11 +193,11 @@ func CreateBranch(ctx *context.Context) {
if form.CreateTag {
target := ctx.Repo.CommitID
if ctx.Repo.IsViewBranch {
if ctx.Repo.RefFullName.IsBranch() {
target = ctx.Repo.BranchName
}
err = release_service.CreateNewTag(ctx, ctx.Doer, ctx.Repo.Repository, target, form.NewBranchName, "")
} else if ctx.Repo.IsViewBranch {
} else if ctx.Repo.RefFullName.IsBranch() {
err = repo_service.CreateNewBranch(ctx, ctx.Doer, ctx.Repo.Repository, ctx.Repo.GitRepo, ctx.Repo.BranchName, form.NewBranchName)
} else {
err = repo_service.CreateNewBranchFromCommit(ctx, ctx.Doer, ctx.Repo.Repository, ctx.Repo.GitRepo, ctx.Repo.CommitID, form.NewBranchName)