MCPcopy Create free account
hub / github.com/gogs/gogs / UpdateSize

Method UpdateSize

internal/database/repo.go:447–458  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

445}
446
447func (r *Repository) UpdateSize() error {
448 countObject, err := git.CountObjects(r.RepoPath())
449 if err != nil {
450 return errors.Newf("count repository objects: %v", err)
451 }
452
453 r.Size = countObject.Size + countObject.SizePack
454 if _, err = x.Id(r.ID).Cols("size").Update(r); err != nil {
455 return errors.Newf("update size: %v", err)
456 }
457 return nil
458}
459
460// ComposeMetas composes a map of metas for rendering SHA1 URL and external issue tracker URL.
461func (r *Repository) ComposeMetas() map[string]string {

Callers 4

ForkRepositoryFunction · 0.95
runSyncMethod · 0.80
PushUpdateFunction · 0.80
MigrateRepositoryFunction · 0.80

Implementers 2

Repositoryinternal/database/repo.go
mailerRepointernal/database/issue_mail.go

Calls 2

RepoPathMethod · 0.95
UpdateMethod · 0.65

Tested by

no test coverage detected