Skip to content

Commit

Permalink
Output simple git status info as-is
Browse files Browse the repository at this point in the history
For now.
  • Loading branch information
carhartl committed Oct 28, 2024
1 parent f9148d2 commit 38276d0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/git-wip/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ type doneMsg struct{}
type errMsg error

type repo struct {
path string
path string
status string
}

func (r repo) Title() string {
return r.path
}

func (r repo) Description() string {
return "Foo" // TODO: Gather Git status here, separated by \n
return r.status
}

func (r repo) FilterValue() string {
Expand Down Expand Up @@ -129,13 +130,13 @@ func getRepos(path string, sub chan repoMsg) tea.Cmd {
// Required until https://github.com/go-git/go-git/issues/1210 is fixed
addDefaultGitignoreToWorktree(w)

status, err := w.Status()
status, err := w.Status() // => git status --porcelain
if err != nil {
return err
}

if !status.IsClean() {
sub <- repoMsg{repo: repo{path: repopath}}
sub <- repoMsg{repo: repo{path: repopath, status: status.String()}}
}
}
return fs.SkipDir
Expand Down

0 comments on commit 38276d0

Please sign in to comment.