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

Function reverted

script/raw-changelog.ts:89–111  ·  view source on GitHub ↗
(commits: Commit[])

Source from the content-addressed store, hash-verified

87}
88
89function reverted(commits: Commit[]) {
90 const seen = new Map<string, Commit>()
91
92 for (const commit of commits) {
93 const match = commit.message.match(/^Revert "(.+)"$/)
94 if (match) {
95 const msg = match[1]!
96 if (seen.has(msg)) seen.delete(msg)
97 else seen.set(commit.message, commit)
98 continue
99 }
100
101 const revert = `Revert "${commit.message}"`
102 if (seen.has(revert)) {
103 seen.delete(revert)
104 continue
105 }
106
107 seen.set(commit.message, commit)
108 }
109
110 return [...seen.values()]
111}
112
113async function commits(from: string, to: string) {
114 const base = ref(from)

Callers 1

commitsFunction · 0.85

Calls 3

deleteMethod · 0.45
setMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected