InitWiki initializes a wiki for repository, it does nothing when repository already has wiki.
()
| 67 | // InitWiki initializes a wiki for repository, |
| 68 | // it does nothing when repository already has wiki. |
| 69 | func (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 | |
| 82 | func (r *Repository) LocalWikiPath() string { |
| 83 | return filepath.Join(conf.Server.AppDataPath, "tmp", "local-wiki", com.ToStr(r.ID)) |
no test coverage detected