summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-01-12 17:36:21 +0800
committerGitHub <noreply@github.com>2020-01-12 17:36:21 +0800
commit5765212c6dbcaeb27779707af3ca57775e535bd9 (patch)
treed3cf5fcedf21486e3b26731ba93cebd8ee13532b /routers
parent65baacf2273f74876b3faed93f60641389a20d39 (diff)
downloadgitea-5765212c6dbcaeb27779707af3ca57775e535bd9.tar.gz
gitea-5765212c6dbcaeb27779707af3ca57775e535bd9.zip
Add owner_name column for table repository for maintaince reason (#9717)
* Add owner_name column for table repository for maintaince reason * refactor * Fix tests * fix test * fix bug when fork repository Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'routers')
-rw-r--r--routers/admin/repos.go2
-rw-r--r--routers/repo/compare.go6
2 files changed, 3 insertions, 5 deletions
diff --git a/routers/admin/repos.go b/routers/admin/repos.go
index 73aa66807b..39a1d7596c 100644
--- a/routers/admin/repos.go
+++ b/routers/admin/repos.go
@@ -43,7 +43,7 @@ func DeleteRepo(ctx *context.Context) {
ctx.ServerError("DeleteRepository", err)
return
}
- log.Trace("Repository deleted: %s/%s", repo.MustOwner().Name, repo.Name)
+ log.Trace("Repository deleted: %s", repo.FullName())
ctx.Flash.Success(ctx.Tr("repo.settings.deletion_success"))
ctx.JSON(200, map[string]interface{}{
diff --git a/routers/repo/compare.go b/routers/repo/compare.go
index d23bccd09a..bb800f9ef7 100644
--- a/routers/repo/compare.go
+++ b/routers/repo/compare.go
@@ -361,10 +361,8 @@ func parseBaseRepoInfo(ctx *context.Context, repo *models.Repository) error {
if err := repo.GetBaseRepo(); err != nil {
return err
}
- if err := repo.BaseRepo.GetOwnerName(); err != nil {
- return err
- }
- baseGitRepo, err := git.OpenRepository(models.RepoPath(repo.BaseRepo.OwnerName, repo.BaseRepo.Name))
+
+ baseGitRepo, err := git.OpenRepository(repo.BaseRepo.RepoPath())
if err != nil {
return err
}