mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 10:18:38 +00:00
Move repository model into models/repo (#17933)
* Some refactors related repository model * Move more methods out of repository * Move repository into models/repo * Fix test * Fix test * some improvements * Remove unnecessary function
This commit is contained in:
@@ -156,7 +156,7 @@ func FinishIssueStopwatch(ctx context.Context, user *user_model.User, issue *Iss
|
||||
return err
|
||||
}
|
||||
|
||||
if err := issue.loadRepo(db.GetEngine(ctx)); err != nil {
|
||||
if err := issue.loadRepo(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ func FinishIssueStopwatch(ctx context.Context, user *user_model.User, issue *Iss
|
||||
// CreateIssueStopwatch creates a stopwatch if not exist, otherwise return an error
|
||||
func CreateIssueStopwatch(ctx context.Context, user *user_model.User, issue *Issue) error {
|
||||
e := db.GetEngine(ctx)
|
||||
if err := issue.loadRepo(e); err != nil {
|
||||
if err := issue.loadRepo(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ func CreateIssueStopwatch(ctx context.Context, user *user_model.User, issue *Iss
|
||||
return err
|
||||
}
|
||||
|
||||
if err := issue.loadRepo(db.GetEngine(ctx)); err != nil {
|
||||
if err := issue.loadRepo(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -248,11 +248,7 @@ func cancelStopwatch(ctx context.Context, user *user_model.User, issue *Issue) e
|
||||
return err
|
||||
}
|
||||
|
||||
if err := issue.loadRepo(e); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := issue.loadRepo(db.GetEngine(ctx)); err != nil {
|
||||
if err := issue.loadRepo(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user