aboutsummaryrefslogtreecommitdiffstats
path: root/services/issue/commit.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/issue/commit.go')
-rw-r--r--services/issue/commit.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/services/issue/commit.go b/services/issue/commit.go
index 5140eebed1..1053a81162 100644
--- a/services/issue/commit.go
+++ b/services/issue/commit.go
@@ -15,6 +15,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/db"
+ issues_model "code.gitea.io/gitea/models/issues"
access_model "code.gitea.io/gitea/models/perm/access"
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
@@ -76,22 +77,22 @@ func timeLogToAmount(str string) int64 {
return a
}
-func issueAddTime(issue *models.Issue, doer *user_model.User, time time.Time, timeLog string) error {
+func issueAddTime(issue *issues_model.Issue, doer *user_model.User, time time.Time, timeLog string) error {
amount := timeLogToAmount(timeLog)
if amount == 0 {
return nil
}
- _, err := models.AddTime(doer, issue, amount, time)
+ _, err := issues_model.AddTime(doer, issue, amount, time)
return err
}
// getIssueFromRef returns the issue referenced by a ref. Returns a nil *Issue
// if the provided ref references a non-existent issue.
-func getIssueFromRef(repo *repo_model.Repository, index int64) (*models.Issue, error) {
- issue, err := models.GetIssueByIndex(repo.ID, index)
+func getIssueFromRef(repo *repo_model.Repository, index int64) (*issues_model.Issue, error) {
+ issue, err := issues_model.GetIssueByIndex(repo.ID, index)
if err != nil {
- if models.IsErrIssueNotExist(err) {
+ if issues_model.IsErrIssueNotExist(err) {
return nil, nil
}
return nil, err
@@ -112,7 +113,7 @@ func UpdateIssuesCommit(doer *user_model.User, repo *repo_model.Repository, comm
refMarked := make(map[markKey]bool)
var refRepo *repo_model.Repository
- var refIssue *models.Issue
+ var refIssue *issues_model.Issue
var err error
for _, ref := range references.FindAllIssueReferences(c.Message) {
@@ -153,7 +154,7 @@ func UpdateIssuesCommit(doer *user_model.User, repo *repo_model.Repository, comm
}
message := fmt.Sprintf(`<a href="%s/commit/%s">%s</a>`, html.EscapeString(repo.Link()), html.EscapeString(url.PathEscape(c.Sha1)), html.EscapeString(strings.SplitN(c.Message, "\n", 2)[0]))
- if err = models.CreateRefComment(doer, refRepo, refIssue, message, c.Sha1); err != nil {
+ if err = issues_model.CreateRefComment(doer, refRepo, refIssue, message, c.Sha1); err != nil {
return err
}