Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2026-01-28 12:11:53 +01:00
committed by GitHub
parent 90e8283458
commit f107bd5c8c
+6 -2
View File
@@ -278,13 +278,16 @@ async function main(args) {
const commitMessage = `Patch from PR #${prNumber}`;
const commitMessagePattern = `^${commitMessage}$`;
// Check if this patch has already been applied by looking for the commit message
try {
const existingCommit = await run(
'git',
'log',
'--extended-regexp',
'--grep',
commitMessage,
commitMessagePattern,
'--format=%H',
'-1',
);
@@ -300,7 +303,8 @@ async function main(args) {
}
let hasChanges = false;
for (const logSha of logLines.split(/\r?\n/)) {
const commitShas = logLines.split(/\r?\n/).filter(Boolean);
for (const logSha of commitShas) {
try {
await run('git', 'cherry-pick', '-n', logSha);
hasChanges = true;