MCPcopy Index your code
hub / github.com/anomalyco/opencode / mergeLiveCommit

Function mergeLiveCommit

packages/opencode/src/cli/cmd/run/subagent-data.ts:378–398  ·  view source on GitHub ↗
(current: StreamCommit, next: StreamCommit)

Source from the content-addressed store, hash-verified

376}
377
378function mergeLiveCommit(current: StreamCommit, next: StreamCommit) {
379 if (current.phase !== "progress" || next.phase !== "progress") {
380 if (sameCommit(current, next)) {
381 return current
382 }
383
384 return next
385 }
386
387 const merged = {
388 ...current,
389 ...next,
390 text: current.text + next.text,
391 }
392
393 if (sameCommit(current, merged)) {
394 return current
395 }
396
397 return merged
398}
399
400function appendCommits(detail: DetailState, commits: StreamCommit[]) {
401 let changed = false

Callers 1

appendCommitsFunction · 0.85

Calls 1

sameCommitFunction · 0.85

Tested by

no test coverage detected