This commit is contained in:
Jabberwocky238
2026-07-17 05:32:14 -04:00
parent a289f1b911
commit 67c07b3bcf
34 changed files with 791 additions and 1 deletions
+13
View File
@@ -31,6 +31,19 @@ func (c *Config) RepoRoot() string {
return filepath.Join(c.Root, "repos")
}
// TemplateDir is the `git init --template` source: <root>/template. The daemon
// materializes it at startup (hooks.EnsureTemplate) so every CreateRepo gets
// forwarding hooks. CreateRepo falls back to plain `git init --bare` if absent.
func (c *Config) TemplateDir() string {
return filepath.Join(c.Root, "template")
}
// HookSock is the unix socket the hook bus listens on: <root>/hook.sock. Hook
// scripts dial it (via `simplegit hook --root=...`) to forward invocations.
func (c *Config) HookSock() string {
return filepath.Join(c.Root, "hook.sock")
}
// Prepare checks that the config is valid and creates the repo root if needed.
func (c *Config) Prepare() error {
if c.prepared.Load() {