This commit is contained in:
matt korwel
2025-09-18 10:10:26 -07:00
committed by GitHub
parent 6b34f38ce0
commit 99b43e1302
2 changed files with 10 additions and 31 deletions

View File

@@ -62,22 +62,7 @@ async function main() {
// Check if hotfix branch already exists
if (branchExists(hotfixBranch)) {
console.log(`Hotfix branch ${hotfixBranch} already exists.`);
// Check if the existing branch already has this commit
const hasCommit = run(
`git branch --contains ${commit} | grep ${hotfixBranch}`,
dryRun,
false,
);
if (hasCommit) {
console.log(`Branch ${hotfixBranch} already contains commit ${commit}.`);
return { existingBranch: hotfixBranch, hasCommit: true };
} else {
console.log(
`Branch ${hotfixBranch} exists but doesn't contain commit ${commit}.`,
);
return { existingBranch: hotfixBranch, hasCommit: false };
}
return { existingBranch: hotfixBranch };
}
// Create the hotfix branch from the release branch.