forked from NYANDEV/forgejo
[GITEA] Allow release creation on commit (squash) s/SHAFullLength/FullLength/
(cherry picked from commit 9d549c0d33b6a16685db6eeff77734e5d60ae96e) (cherry picked from commit 8b2af5f040b968dd40579be110b734b4baa822c7) (cherry picked from commit 2262654cd75f2ef49ef5d8b6e3c534460c2742a9) (cherry picked from commit 5e98785109f846355e11ea14bcb6f70477812941)
This commit is contained in:
parent
f863f4b005
commit
16e337153b
1 changed files with 6 additions and 1 deletions
|
@ -397,9 +397,14 @@ func NewReleasePost(ctx *context.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
objectFormat, err := ctx.Repo.GitRepo.GetObjectFormat()
|
||||||
|
if err != nil {
|
||||||
|
ctx.ServerError("GetCommit", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
// form.Target can be a branch name or a full commitID.
|
// form.Target can be a branch name or a full commitID.
|
||||||
if !ctx.Repo.GitRepo.IsBranchExist(form.Target) &&
|
if !ctx.Repo.GitRepo.IsBranchExist(form.Target) &&
|
||||||
len(form.Target) == git.SHAFullLength && !ctx.Repo.GitRepo.IsCommitExist(form.Target) {
|
len(form.Target) == objectFormat.FullLength() && !ctx.Repo.GitRepo.IsCommitExist(form.Target) {
|
||||||
ctx.RenderWithErr(ctx.Tr("form.target_branch_not_exist"), tplReleaseNew, &form)
|
ctx.RenderWithErr(ctx.Tr("form.target_branch_not_exist"), tplReleaseNew, &form)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue