mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-29 19:40:47 +00:00
refactor: git repo and relative path handling (#38522)
1. simplify "StorageRepo" code 2. simplify git.OpenRepository code 3. by the way, clean up some unused files in git test fixtures.
This commit is contained in:
@@ -159,12 +159,12 @@ func migratePushMirrors(x db.EngineMigration) error {
|
||||
|
||||
func getRemoteAddress(ownerName, repoName, remoteName string) (string, error) {
|
||||
ctx := context.Background()
|
||||
relativePath := repo_model.RelativePath(ownerName, repoName)
|
||||
if exist, _ := gitrepo.IsRepositoryExist(ctx, repo_model.StorageRepo(relativePath)); !exist {
|
||||
repo := repo_model.CodeRepoByName(ownerName, repoName)
|
||||
if exist, _ := gitrepo.IsRepositoryExist(ctx, repo); !exist {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
u, err := gitrepo.GitRemoteGetURL(ctx, repo_model.StorageRepo(relativePath), remoteName)
|
||||
u, err := gitrepo.GitRemoteGetURL(ctx, repo, remoteName)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user