1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-23 02:38:35 +00:00

Add file status on API (#7671)

* add file status on API

* fix tests

* fix tests

* fix tests
This commit is contained in:
Lunny Xiao
2019-08-21 13:16:22 +08:00
committed by GitHub
parent 5f7fccaf55
commit 09ca391230
4 changed files with 84 additions and 40 deletions

View File

@@ -193,12 +193,16 @@ func CommitRepoAction(opts CommitRepoActionOptions) error {
}
if isHookEventPush {
commits, err := opts.Commits.ToAPIPayloadCommits(repo.RepoPath(), repo.HTMLURL())
if err != nil {
return err
}
if err = models.PrepareWebhooks(repo, models.HookEventPush, &api.PushPayload{
Ref: opts.RefFullName,
Before: opts.OldCommitID,
After: opts.NewCommitID,
CompareURL: setting.AppURL + opts.Commits.CompareURL,
Commits: opts.Commits.ToAPIPayloadCommits(repo.HTMLURL()),
Commits: commits,
Repo: apiRepo,
Pusher: apiPusher,
Sender: apiPusher,