diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-11-29 10:21:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-29 10:21:05 +0800 |
commit | e151674cfa4255938f974cfb050b5222db77dcf5 (patch) | |
tree | 6b23a3b59643ce9fb385d5a67c213249b14cf113 /modules/repofiles/update.go | |
parent | 54dab5aed999c1c3c0dd247de54a9cc2f9e6ebef (diff) | |
download | gitea-e151674cfa4255938f974cfb050b5222db77dcf5.tar.gz gitea-e151674cfa4255938f974cfb050b5222db77dcf5.zip |
Move PushUpdateOptions from models to repofiles (#9124)
Diffstat (limited to 'modules/repofiles/update.go')
-rw-r--r-- | modules/repofiles/update.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/repofiles/update.go b/modules/repofiles/update.go index ef56609f4d..c1eae53099 100644 --- a/modules/repofiles/update.go +++ b/modules/repofiles/update.go @@ -410,9 +410,20 @@ func CreateOrUpdateRepoFile(repo *models.Repository, doer *models.User, opts *Up return file, nil } +// PushUpdateOptions defines the push update options +type PushUpdateOptions struct { + PusherID int64 + PusherName string + RepoUserName string + RepoName string + RefFullName string + OldCommitID string + NewCommitID string +} + // PushUpdate must be called for any push actions in order to // generates necessary push action history feeds and other operations -func PushUpdate(repo *models.Repository, branch string, opts models.PushUpdateOptions) error { +func PushUpdate(repo *models.Repository, branch string, opts PushUpdateOptions) error { isNewRef := opts.OldCommitID == git.EmptySHA isDelRef := opts.NewCommitID == git.EmptySHA if isNewRef && isDelRef { |