diff options
Diffstat (limited to 'services/repository/push.go')
-rw-r--r-- | services/repository/push.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/services/repository/push.go b/services/repository/push.go index 97554c6490..7b439a41f4 100644 --- a/services/repository/push.go +++ b/services/repository/push.go @@ -13,6 +13,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/models/db" + user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/cache" "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/graceful" @@ -93,7 +94,7 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error { addTags := make([]string, 0, len(optsList)) delTags := make([]string, 0, len(optsList)) - var pusher *models.User + var pusher *user_model.User for _, opts := range optsList { if opts.IsNewRef() && opts.IsDelRef() { @@ -102,7 +103,7 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error { if opts.IsTag() { // If is tag reference if pusher == nil || pusher.ID != opts.PusherID { var err error - if pusher, err = models.GetUserByID(opts.PusherID); err != nil { + if pusher, err = user_model.GetUserByID(opts.PusherID); err != nil { return err } } @@ -133,7 +134,7 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error { } else if opts.IsBranch() { // If is branch reference if pusher == nil || pusher.ID != opts.PusherID { var err error - if pusher, err = models.GetUserByID(opts.PusherID); err != nil { + if pusher, err = user_model.GetUserByID(opts.PusherID); err != nil { return err } } @@ -276,7 +277,7 @@ func pushUpdateAddTags(ctx context.Context, repo *models.Repository, gitRepo *gi newReleases := make([]*models.Release, 0, len(lowerTags)-len(relMap)) - emailToUser := make(map[string]*models.User) + emailToUser := make(map[string]*user_model.User) for i, lowerTag := range lowerTags { tag, err := gitRepo.GetTag(tags[i]) @@ -295,15 +296,15 @@ func pushUpdateAddTags(ctx context.Context, repo *models.Repository, gitRepo *gi if sig == nil { sig = commit.Committer } - var author *models.User + var author *user_model.User var createdAt = time.Unix(1, 0) if sig != nil { var ok bool author, ok = emailToUser[sig.Email] if !ok { - author, err = models.GetUserByEmailContext(ctx, sig.Email) - if err != nil && !models.IsErrUserNotExist(err) { + author, err = user_model.GetUserByEmailContext(ctx, sig.Email) + if err != nil && !user_model.IsErrUserNotExist(err) { return fmt.Errorf("GetUserByEmail: %v", err) } if author != nil { |