(status: GitStatus)
| 316 | } |
| 317 | |
| 318 | export function formatGitBadgeBase(status: GitStatus): string { |
| 319 | const parts: string[] = []; |
| 320 | const diff = formatDiffStats(status); |
| 321 | if (diff) parts.push(diff); |
| 322 | let sync = ''; |
| 323 | if (status.ahead > 0) sync += `↑${status.ahead}`; |
| 324 | if (status.behind > 0) sync += `↓${status.behind}`; |
| 325 | if (sync) parts.push(sync); |
| 326 | return parts.length === 0 ? status.branch : `${status.branch} [${parts.join(' ')}]`; |
| 327 | } |
| 328 | |
| 329 | export function formatPullRequestBadge( |
| 330 | pullRequest: PullRequestInfo, |
no test coverage detected