summaryrefslogtreecommitdiffstats
path: root/services/mirror/mirror_pull.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-12-12 23:48:20 +0800
committerGitHub <noreply@github.com>2021-12-12 23:48:20 +0800
commit572324049008ac803d3d7c17a7b3a81ef00386fc (patch)
treea9c3709643a23165d27aa67e76f10f26a89936d5 /services/mirror/mirror_pull.go
parent0a7e8327a017c5dd43e552bbcd0d0f056bc1671b (diff)
downloadgitea-572324049008ac803d3d7c17a7b3a81ef00386fc.tar.gz
gitea-572324049008ac803d3d7c17a7b3a81ef00386fc.zip
Some repository refactors (#17950)
* some repository refactors * remove unnecessary code * Fix test * Remove unnecessary banner
Diffstat (limited to 'services/mirror/mirror_pull.go')
-rw-r--r--services/mirror/mirror_pull.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/services/mirror/mirror_pull.go b/services/mirror/mirror_pull.go
index 1a15849226..da2221d915 100644
--- a/services/mirror/mirror_pull.go
+++ b/services/mirror/mirror_pull.go
@@ -60,7 +60,7 @@ func UpdateAddress(m *repo_model.Mirror, addr string) error {
}
m.Repo.OriginalURL = addr
- return models.UpdateRepositoryCols(m.Repo, "original_url")
+ return repo_model.UpdateRepositoryCols(m.Repo, "original_url")
}
// mirrorSyncResult contains information of a updated reference.
@@ -476,7 +476,7 @@ func SyncPullMirror(ctx context.Context, repoID int64) bool {
return false
}
- if err = models.UpdateRepositoryUpdatedTime(m.RepoID, commitDate); err != nil {
+ if err = repo_model.UpdateRepositoryUpdatedTime(m.RepoID, commitDate); err != nil {
log.Error("Update repository 'updated_unix' [%d]: %v", m.RepoID, err)
return false
}
@@ -539,7 +539,7 @@ func checkAndUpdateEmptyRepository(m *repo_model.Mirror, gitRepo *git.Repository
}
m.Repo.IsEmpty = false
// Update the is empty and default_branch columns
- if err := models.UpdateRepositoryCols(m.Repo, "default_branch", "is_empty"); err != nil {
+ if err := repo_model.UpdateRepositoryCols(m.Repo, "default_branch", "is_empty"); err != nil {
log.Error("Failed to update default branch of repository %-v. Error: %v", m.Repo, err)
desc := fmt.Sprintf("Failed to uupdate default branch of repository '%s': %v", m.Repo.RepoPath(), err)
if err = admin_model.CreateRepositoryNotice(desc); err != nil {