mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 19:38:23 +00:00 
			
		
		
		
	Use complete SHA to create and query commit status (#22244)
Fix #13485. Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
		| @@ -279,6 +279,10 @@ func NewCommitStatus(opts NewCommitStatusOptions) error { | ||||
| 		return fmt.Errorf("NewCommitStatus[%s, %s]: no user specified", repoPath, opts.SHA) | ||||
| 	} | ||||
|  | ||||
| 	if _, err := git.NewIDFromString(opts.SHA); err != nil { | ||||
| 		return fmt.Errorf("NewCommitStatus[%s, %s]: invalid sha: %w", repoPath, opts.SHA, err) | ||||
| 	} | ||||
|  | ||||
| 	ctx, committer, err := db.TxContext(db.DefaultContext) | ||||
| 	if err != nil { | ||||
| 		return fmt.Errorf("NewCommitStatus[repo_id: %d, user_id: %d, sha: %s]: %w", opts.Repo.ID, opts.Creator.ID, opts.SHA, err) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user