Skip to content

Commit 4794f60

Browse files
committed
Get back to right branch in freeze patch logic
1 parent cf892ff commit 4794f60

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/apply-patches.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ async function applyFreezePatches(rawFolder, outputFolder) {
116116
const outputIndex = await loadJSON(path.join(outputFolder, 'index.json'));
117117
let patchApplied = false;
118118

119+
const { stdout } = await execFile('git', ['rev-parse', '--abbrev-ref', 'HEAD']);
120+
const currentBranch = stdout.trim();
121+
119122
for (const file of patchFiles) {
120123
if (!file.endsWith('.json')) {
121124
continue;
@@ -147,7 +150,7 @@ async function applyFreezePatches(rawFolder, outputFolder) {
147150
outputIndex.results.splice(outputSpecPos, 1, crawlSpec);
148151
}
149152

150-
await execFile('git', ['checkout', 'main']);
153+
await execFile('git', ['checkout', currentBranch]);
151154
patchApplied = true;
152155
}
153156

0 commit comments

Comments
 (0)