aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorL0veSunshine <xuan199651@gmail.com>2020-04-08 20:13:04 +0800
committerGitHub <noreply@github.com>2020-04-08 15:13:04 +0300
commit08208cdfb87bc3f0b534eda9d9ef265dcfbc18c3 (patch)
tree1a5dd7d1dde5c1636666dd478b4e05994882cd4c /modules
parentb40107c4164748873f89a9553ed24e8403999339 (diff)
downloadgitea-08208cdfb87bc3f0b534eda9d9ef265dcfbc18c3.tar.gz
gitea-08208cdfb87bc3f0b534eda9d9ef265dcfbc18c3.zip
Fix forked repo has no icon and language stat. (#10791)
* Update header.tmpl * Update _repository.less * Update pull.go * Update indexer.go * Update pull.go * Update pull.go * Update indexer.go * fix forked repo doesn't have language stat * fix forked repo doesn't have language stat * fix forked repo doesn't have language stat * fix forked repo doesn't have language stat * fix forked repo doesn't have language stat * fix forked repo doesn't have language stat * fix forked repo doesn't have language stat * fix forked repo doesn't have language stat * fix forked repo doesn't have language stat * fix forked repo doesn't have language stat * fix forked repo doesn't have language stat Thanks the advice from lunny and 6543. * fix forked repo doesn't have language stat Modified as suggested by 6543. * fix forked repo doesn't have language stat simplify the function. * fix forked repo doesn't have language stat update the indexer after the loop Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'modules')
-rw-r--r--modules/repository/fork.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/repository/fork.go b/modules/repository/fork.go
index 638d3588ec..2ed2a0eb78 100644
--- a/modules/repository/fork.go
+++ b/modules/repository/fork.go
@@ -82,6 +82,8 @@ func ForkRepository(doer, owner *models.User, oldRepo *models.Repository, name,
if err = repo.UpdateSize(ctx); err != nil {
log.Error("Failed to update size for repository: %v", err)
}
-
+ if err := models.CopyLanguageStat(oldRepo, repo); err != nil {
+ log.Error("Copy language stat from oldRepo failed")
+ }
return repo, models.CopyLFS(ctx, repo, oldRepo)
}