MCPcopy Create free account
hub / github.com/cwarden/git-add--interactive / showInteractiveStatus

Method showInteractiveStatus

internal/ui/app.go:42–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40}
41
42func (a *App) showInteractiveStatus() {
43 files, err := a.repo.ListModified("")
44 if err != nil {
45 return // Silently skip status on error
46 }
47
48 if len(files) == 0 {
49 return // No files to show
50 }
51
52 fmt.Printf(" %s %s %s\n", "staged", "unstaged", "path")
53 for i, file := range files {
54 stagePart := file.Index
55 if stagePart == "" {
56 stagePart = "unchanged"
57 }
58 unstagePart := file.File
59 if unstagePart == "" {
60 unstagePart = "nothing"
61 }
62 fmt.Printf(" %d: %-12s %s %s\n",
63 i+1, stagePart, unstagePart, file.Path)
64 }
65}
66
67func (a *App) initColors() {
68 a.colors.UseColor = a.repo.GetColorBool("color.interactive")

Callers 1

RunInteractiveMethod · 0.95

Calls 1

ListModifiedMethod · 0.80

Tested by

no test coverage detected