@@ -14,7 +14,6 @@ import (
1414 repo_model "code.gitea.io/gitea/models/repo"
1515 user_model "code.gitea.io/gitea/models/user"
1616 "code.gitea.io/gitea/modules/cache"
17- "code.gitea.io/gitea/modules/git"
1817 "code.gitea.io/gitea/modules/gitrepo"
1918 "code.gitea.io/gitea/modules/json"
2019 "code.gitea.io/gitea/modules/log"
@@ -79,16 +78,10 @@ func CreateCommitStatus(ctx context.Context, repo *repo_model.Repository, creato
7978 }
8079 defer closer .Close ()
8180
82- objectFormat := git .ObjectFormatFromName (repo .ObjectFormatName )
83-
8481 commit , err := gitRepo .GetCommit (sha )
8582 if err != nil {
8683 return fmt .Errorf ("GetCommit[%s]: %w" , sha , err )
8784 }
88- if len (sha ) != objectFormat .FullLength () {
89- // use complete commit sha
90- sha = commit .ID .String ()
91- }
9285
9386 if err := db .WithTx (ctx , func (ctx context.Context ) error {
9487 if err := git_model .NewCommitStatus (ctx , git_model.NewCommitStatusOptions {
@@ -105,6 +98,10 @@ func CreateCommitStatus(ctx context.Context, repo *repo_model.Repository, creato
10598 return err
10699 }
107100
101+ pushCommit := repo_module .CommitToPushCommit (commit )
102+
103+ notify .CreateCommitStatus (ctx , repo , pushCommit , creator , status )
104+
108105 defaultBranchCommit , err := gitRepo .GetBranchCommit (repo .DefaultBranch )
109106 if err != nil {
110107 return fmt .Errorf ("GetBranchCommit[%s]: %w" , repo .DefaultBranch , err )
0 commit comments