MCPcopy Index your code
hub / github.com/continuedev/continue / collectDiffStats

Function collectDiffStats

extensions/cli/src/util/exit.ts:31–48  ·  view source on GitHub ↗

* Collect diff stats and add to metadata * @returns Whether there were any changes

(
  metadata: Record<string, any>,
)

Source from the content-addressed store, hash-verified

29 * @returns Whether there were any changes
30 */
31async function collectDiffStats(
32 metadata: Record<string, any>,
33): Promise<boolean> {
34 try {
35 const { diff, repoFound } = await getGitDiffSnapshot();
36 if (repoFound && diff) {
37 const { additions, deletions } = calculateDiffStats(diff);
38 if (additions > 0 || deletions > 0) {
39 metadata.additions = additions;
40 metadata.deletions = deletions;
41 return true;
42 }
43 }
44 } catch (err) {
45 logger.debug("Failed to calculate diff stats (non-critical)", err as any);
46 }
47 return false;
48}
49
50/**
51 * Extract summary from conversation history and add to metadata

Callers 1

updateAgentMetadataFunction · 0.85

Calls 3

getGitDiffSnapshotFunction · 0.85
calculateDiffStatsFunction · 0.85
debugMethod · 0.45

Tested by

no test coverage detected