MCPcopy Index your code
hub / github.com/cli/cli / formatGitStatus

Function formatGitStatus

pkg/cmd/codespace/view.go:114–122  ·  view source on GitHub ↗
(codespace codespace)

Source from the content-addressed store, hash-verified

112}
113
114func formatGitStatus(codespace codespace) string {
115 branchWithGitStatus := codespace.branchWithGitStatus()
116
117 // Format the commits ahead/behind with proper pluralization
118 commitsAhead := text.Pluralize(codespace.GitStatus.Ahead, "commit")
119 commitsBehind := text.Pluralize(codespace.GitStatus.Behind, "commit")
120
121 return fmt.Sprintf("%s - %s ahead, %s behind", branchWithGitStatus, commitsAhead, commitsBehind)
122}
123
124func formatRetentionPeriodDays(codespace codespace) string {
125 days := codespace.RetentionPeriodMinutes / minutesInDay

Callers 1

ViewCodespaceMethod · 0.85

Calls 2

PluralizeFunction · 0.92
branchWithGitStatusMethod · 0.80

Tested by

no test coverage detected