1 files changed,
12 insertions(+),
4 deletions(-)
Author:
Oleksandr Smirnov
olexsmir@gmail.com
Committed at:
2026-01-22 01:48:03 +0200
Change ID:
mrxkynnzzvvqrzmrorrturwzypzzmyun
Parent:
20913e1
M
internal/git/repo.go
@@ -2,6 +2,8 @@ package git
import ( "fmt" + "os" + "path/filepath" "sort" "github.com/go-git/go-git/v5"@@ -140,13 +142,19 @@ return branches, err
} func (g *Repo) Description() (string, error) { - c, err := g.r.Config() + // TODO: ??? Support both mugit.description and /description file + + path := filepath.Join(g.path, "description") + if _, err := os.Stat(path); err != nil { + return "", fmt.Errorf("no description file found") + } + + d, err := os.ReadFile(path) if err != nil { - return "", fmt.Errorf("failed to read config: %w", err) + return "", fmt.Errorf("failed to read description: %w", err) } - s := c.Raw.Section("mugit") - return s.Options.Get("description"), nil + return string(d), nil } func (g *Repo) IsPrivate() (bool, error) {