(current: StreamCommit, next: StreamCommit)
| 376 | } |
| 377 | |
| 378 | function 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 | |
| 400 | function appendCommits(detail: DetailState, commits: StreamCommit[]) { |
| 401 | let changed = false |
no test coverage detected