updateSize when create a repo with init commit (#13441)

Signed-off-by: a1012112796 <1012112796@qq.com>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
tokarchuk/v1.17
a1012112796 4 years ago committed by GitHub
parent 172eca1cd3
commit 82cf67a93e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      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

Loading…
Cancel
Save