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

Method InitWiki

internal/database/wiki.go:69–80  ·  view source on GitHub ↗

InitWiki initializes a wiki for repository, it does nothing when repository already has wiki.

()

Source from the content-addressed store, hash-verified

67// InitWiki initializes a wiki for repository,
68// it does nothing when repository already has wiki.
69func (r *Repository) InitWiki() error {
70 if r.HasWiki() {
71 return nil
72 }
73
74 if err := git.Init(r.WikiPath(), git.InitOptions{Bare: true}); err != nil {
75 return errors.Newf("init repository: %v", err)
76 } else if err = createDelegateHooks(r.WikiPath()); err != nil {
77 return errors.Newf("createDelegateHooks: %v", err)
78 }
79 return nil
80}
81
82func (r *Repository) LocalWikiPath() string {
83 return filepath.Join(conf.Server.AppDataPath, "tmp", "local-wiki", com.ToStr(r.ID))

Callers 1

updateWikiPageMethod · 0.95

Implementers 2

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

Calls 3

HasWikiMethod · 0.95
WikiPathMethod · 0.95
createDelegateHooksFunction · 0.85

Tested by

no test coverage detected