| 87 | } |
| 88 | |
| 89 | function 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 | |
| 113 | async function commits(from: string, to: string) { |
| 114 | const base = ref(from) |