Some checks failed
cache-seeder / prune (push) Has been skipped
cache-seeder / frontend (push) Failing after 3s
cache-seeder / python (push) Failing after 3s
cache-seeder / gobuild (push) Failing after 4s
cache-seeder / lint (bindata, lint-backend) (push) Failing after 3s
giteabot backport / giteabot (push) Has been skipped
giteabot / giteabot (push) Has been skipped
cache-prune / prune (push) Has been skipped
release-nightly-snapcraft / build-and-publish (ubuntu-24.04) (push) Has been cancelled
release-nightly-snapcraft / build-and-publish (ubuntu-24.04-arm) (push) Has been cancelled
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
cron-renovate / cron-renovate (push) Has been skipped
26 lines
1.0 KiB
Go
26 lines
1.0 KiB
Go
// Copyright 2026 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package base
|
|
|
|
import (
|
|
"gitea.dev/models/db" //nolint:depguard // allow to access db in migration
|
|
"gitea.dev/modules/git/gitrepo"
|
|
)
|
|
|
|
// HINT: MIGRATION-STRUCT-FROZEN: the structs used in migrations should not be affected by the changes happen in the future,
|
|
// because the details can be different in different releases.
|
|
// e.g. if one migration uses "User" model, it works in the early releases,
|
|
// then one day, when the User model changes, the existing migration will break because it will use the new (incorrect) User model,
|
|
// it should only use the old User model.
|
|
//
|
|
// Related: "models", "modules/structs", git repo directory layout on the disk, etc.
|
|
//
|
|
// If changes happen, the old migrations need to use a snapshot struct/function (copy the code and freeze)
|
|
|
|
type ResourceIndex = db.ResourceIndex
|
|
|
|
func LocalCodeGitRepo(ownerName, repoName string) gitrepo.RepositoryFacade {
|
|
return gitrepo.CodeRepoByName(ownerName, repoName)
|
|
}
|