MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / formatGitBadgeBase

Function formatGitBadgeBase

apps/kimi-code/src/utils/git/git-status.ts:318–327  ·  view source on GitHub ↗
(status: GitStatus)

Source from the content-addressed store, hash-verified

316}
317
318export 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
329export function formatPullRequestBadge(
330 pullRequest: PullRequestInfo,

Callers 2

formatFooterGitBadgeFunction · 0.90
formatGitBadgeFunction · 0.85

Calls 2

formatDiffStatsFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected