aboutsummaryrefslogtreecommitdiffstats
path: root/modules/repofiles/upload.go
diff options
context:
space:
mode:
authorAntoine GIRARD <sapk@users.noreply.github.com>2019-08-11 22:31:18 +0200
committerLauris BH <lauris@nix.lv>2019-08-11 23:31:18 +0300
commite9bb75d8d18ba88dc26e4c4af6dc66812a9b8fb6 (patch)
treea4940d4ff3c8c16015a13be3c8540ec63565890b /modules/repofiles/upload.go
parent8bfeb85f93ccd41289f901977243258e1b69f4d6 (diff)
downloadgitea-e9bb75d8d18ba88dc26e4c4af6dc66812a9b8fb6.tar.gz
gitea-e9bb75d8d18ba88dc26e4c4af6dc66812a9b8fb6.zip
Fix duplicate call of webhook (#7821)
Diffstat (limited to 'modules/repofiles/upload.go')
-rw-r--r--modules/repofiles/upload.go27
1 files changed, 0 insertions, 27 deletions
diff --git a/modules/repofiles/upload.go b/modules/repofiles/upload.go
index 2da101c64d..f2ffec7ebc 100644
--- a/modules/repofiles/upload.go
+++ b/modules/repofiles/upload.go
@@ -11,7 +11,6 @@ import (
"strings"
"code.gitea.io/gitea/models"
- "code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/lfs"
"code.gitea.io/gitea/modules/setting"
)
@@ -177,31 +176,5 @@ func UploadRepoFiles(repo *models.Repository, doer *models.User, opts *UploadRep
return err
}
- // Simulate push event.
- oldCommitID := opts.LastCommitID
- if opts.NewBranch != opts.OldBranch {
- oldCommitID = git.EmptySHA
- }
-
- if err = repo.GetOwner(); err != nil {
- return fmt.Errorf("GetOwner: %v", err)
- }
- err = PushUpdate(
- repo,
- opts.NewBranch,
- models.PushUpdateOptions{
- PusherID: doer.ID,
- PusherName: doer.Name,
- RepoUserName: repo.Owner.Name,
- RepoName: repo.Name,
- RefFullName: git.BranchPrefix + opts.NewBranch,
- OldCommitID: oldCommitID,
- NewCommitID: commitHash,
- },
- )
- if err != nil {
- return fmt.Errorf("PushUpdate: %v", err)
- }
-
return models.DeleteUploads(uploads...)
}