MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / worktreeDisplayPath

Method worktreeDisplayPath

internal/tui/picker.go:627–637  ·  view source on GitHub ↗

worktreeDisplayPath returns a display-friendly worktree path.

(entry PRDEntry)

Source from the content-addressed store, hash-verified

625
626// worktreeDisplayPath returns a display-friendly worktree path.
627func (p *PRDPicker) worktreeDisplayPath(entry PRDEntry) string {
628 if entry.WorktreeDir == "" {
629 return "(current directory)"
630 }
631 // Show relative path from base dir
632 rel, err := filepath.Rel(p.basePath, entry.WorktreeDir)
633 if err != nil {
634 return entry.WorktreeDir
635 }
636 return rel + "/"
637}
638
639// formatBranchPath formats branch and path info to fit within maxWidth.
640// maxWidth is in display characters (runes).

Calls

no outgoing calls