MCPcopy Create free account
hub / github.com/alibaba/open-code-review / formatDiffEntry

Function formatDiffEntry

internal/agent/agent.go:1679–1690  ·  view source on GitHub ↗

formatDiffEntry renders one changed file as STATUS path (+N/-M). It is the shared shape for both the grouping file list and the other-changed-files block, so every prompt that enumerates files presents them identically.

(d model.Diff)

Source from the content-addressed store, hash-verified

1677// shared shape for both the grouping file list and the other-changed-files
1678// block, so every prompt that enumerates files presents them identically.
1679func formatDiffEntry(d model.Diff) string {
1680 status := "MODIFIED"
1681 switch {
1682 case d.IsNew:
1683 status = "ADDED"
1684 case d.IsDeleted:
1685 status = "DELETED"
1686 case d.IsRenamed:
1687 status = "RENAMED"
1688 }
1689 return fmt.Sprintf("%s %s (+%d/-%d)", status, effectivePath(d), d.Insertions, d.Deletions)
1690}
1691
1692// buildChangeFilesExceptGroup returns a formatted list of changed files excluding all group members.
1693func (a *Agent) buildChangeFilesExceptGroup(groupDiffs []model.Diff) string {

Callers 2

buildFileListFunction · 0.85

Calls 1

effectivePathFunction · 0.85

Tested by

no test coverage detected