diff --git a/config/config.go b/config/config.go index 8351c775c0d01d2fef669f6a7eed1ade37973fd8..d64fa9fddf8c7feb87841f3ced52e23e756cbfb7 100644 --- a/config/config.go +++ b/config/config.go @@ -154,6 +154,7 @@ func (cfg *Config) Reload() error { rp = rr.Readme r.name = rr.Name r.description = rr.Note + r.private = rr.Private break } } @@ -232,14 +233,15 @@ func (cfg *Config) createDefaultConfigRepo(yaml string) error { if err != nil { return err } - author := &object.Signature{ + author := object.Signature{ Name: "Soft Serve Server", Email: "vt100@charm.sh", When: time.Now(), } _, err = wt.Commit("Default init", &ggit.CommitOptions{ - All: true, - Author: author, + All: true, + Author: &author, + Committer: &author, }) if err != nil { return err diff --git a/config/git.go b/config/git.go index 2b82f0a38b9fea54f7ee75a3f25fa0f092d4887a..a5566d47796cb1719d535fa24512456e1c9bcfcd 100644 --- a/config/git.go +++ b/config/git.go @@ -26,6 +26,7 @@ type Repo struct { head *git.Reference refs []*git.Reference patchCache *lru.Cache + private bool } // open opens a Git repository. @@ -50,6 +51,11 @@ func (rs *RepoSource) open(path string) (*Repo, error) { return r, nil } +// IsPrivate returns true if the repository is private. +func (r *Repo) IsPrivate() bool { + return r.private +} + // Path returns the path to the repository. func (r *Repo) Path() string { return r.path