Create .gitignore in sgard init to exclude blobs/ from git.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-23 22:26:34 -07:00
parent db9aa7bbff
commit caf1698c16
2 changed files with 13 additions and 0 deletions

View File

@@ -46,6 +46,11 @@ func Init(root string) (*Garden, error) {
return nil, fmt.Errorf("creating store: %w", err)
}
gitignorePath := filepath.Join(absRoot, ".gitignore")
if err := os.WriteFile(gitignorePath, []byte("blobs/\n"), 0o644); err != nil {
return nil, fmt.Errorf("creating .gitignore: %w", err)
}
clk := clockwork.NewRealClock()
m := manifest.NewWithTime(clk.Now().UTC())
if err := m.Save(manifestPath); err != nil {