diff options
author | a1012112796 <1012112796@qq.com> | 2020-11-07 12:44:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-06 23:44:08 -0500 |
commit | 82cf67a93e7153747f4e324ea666e7789cd46c07 (patch) | |
tree | b919785005417fbde20808aec2704eb9d6f56359 /models | |
parent | 172eca1cd3c17d92e4bee63b1d0ab66f3021df25 (diff) | |
download | gitea-82cf67a93e7153747f4e324ea666e7789cd46c07.tar.gz gitea-82cf67a93e7153747f4e324ea666e7789cd46c07.zip |
updateSize when create a repo with init commit (#13441)
Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'models')
-rw-r--r-- | models/repo.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/models/repo.go b/models/repo.go index 5198026329..2b53ac666c 100644 --- a/models/repo.go +++ b/models/repo.go @@ -1501,6 +1501,10 @@ func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err e return fmt.Errorf("update: %v", err) } + if err = repo.updateSize(e); err != nil { + log.Error("Failed to update size for repository: %v", err) + } + if visibilityChanged { if err = repo.getOwner(e); err != nil { return fmt.Errorf("getOwner: %v", err) @@ -1546,10 +1550,6 @@ func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err e return fmt.Errorf("updateRepository[%d]: %v", forkRepos[i].ID, err) } } - - if err = repo.updateSize(e); err != nil { - log.Error("Failed to update size for repository: %v", err) - } } return nil |