summaryrefslogtreecommitdiffstats
path: root/services/issue/commit.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-08-25 10:31:57 +0800
committerGitHub <noreply@github.com>2022-08-25 10:31:57 +0800
commit1d8543e7db58d7c4973758e47f005c4d8bd7d7a3 (patch)
treeb60c99e2dfd69ccb998f8a0829d98d7cadcf0d6b /services/issue/commit.go
parent4a4bfafa238bf48851f8c11fa3701bd42b912475 (diff)
downloadgitea-1d8543e7db58d7c4973758e47f005c4d8bd7d7a3.tar.gz
gitea-1d8543e7db58d7c4973758e47f005c4d8bd7d7a3.zip
Move some files into models' sub packages (#20262)
* Move some files into models' sub packages * Move functions * merge main branch * Fix check * fix check * Fix some tests * Fix lint * Fix lint * Revert lint changes * Fix error comments * Fix lint Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'services/issue/commit.go')
-rw-r--r--services/issue/commit.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/services/issue/commit.go b/services/issue/commit.go
index 1053a81162..0d04de81bc 100644
--- a/services/issue/commit.go
+++ b/services/issue/commit.go
@@ -13,12 +13,12 @@ import (
"strings"
"time"
- "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"
+ "code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/references"
"code.gitea.io/gitea/modules/repository"
)
@@ -119,8 +119,13 @@ func UpdateIssuesCommit(doer *user_model.User, repo *repo_model.Repository, comm
// issue is from another repo
if len(ref.Owner) > 0 && len(ref.Name) > 0 {
- refRepo, err = models.GetRepositoryFromMatch(ref.Owner, ref.Name)
+ refRepo, err = repo_model.GetRepositoryByOwnerAndName(ref.Owner, ref.Name)
if err != nil {
+ if repo_model.IsErrRepoNotExist(err) {
+ log.Warn("Repository referenced in commit but does not exist: %v", err)
+ } else {
+ log.Error("repo_model.GetRepositoryByOwnerAndName: %v", err)
+ }
continue
}
} else {