mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-11-04 00:11:04 +00:00 
			
		
		
		
	[GITEA] Allow release creation on commit (squash) s/SHAFullLength/FullLength/
This commit is contained in:
		
					parent
					
						
							
								19dc5ef5e5
							
						
					
				
			
			
				commit
				
					
						9d549c0d33
					
				
			
		
					 1 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
					@ -391,9 +391,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…
	
	Add table
		Add a link
		
	
		Reference in a new issue