Attempt to make this work

This commit is contained in:
Mark Wylde
2025-05-30 22:44:19 +01:00
parent 4b69e8485a
commit 0bb118b1a2

View File

@@ -122,28 +122,25 @@ export async function setupBranch(
// Verify the branch was created // Verify the branch was created
const currentBranch = await $`git branch --show-current`; const currentBranch = await $`git branch --show-current`;
console.log( const branchName = currentBranch.toString().trim();
`Current branch after creation: ${currentBranch.stdout.trim()}`, console.log(`Current branch after creation: ${branchName}`);
);
if (currentBranch.stdout.trim() === newBranch) { if (branchName === newBranch) {
console.log( console.log(
`✅ Successfully created and checked out branch: ${newBranch}`, `✅ Successfully created and checked out branch: ${newBranch}`,
); );
} else { } else {
throw new Error( throw new Error(
`Branch creation failed. Expected ${newBranch}, got ${currentBranch.stdout.trim()}`, `Branch creation failed. Expected ${newBranch}, got ${branchName}`,
); );
} }
} catch (gitError: any) { } catch (gitError: any) {
console.error(`❌ Git operations failed:`, gitError); console.error(`❌ Git operations failed:`, gitError);
console.error(`Error message: ${gitError.message}`); console.error(`Error message: ${gitError.message || gitError}`);
console.error(`Error stdout: ${gitError.stdout}`);
console.error(`Error stderr: ${gitError.stderr}`);
// This is a critical failure - the branch MUST be created for Claude to work // This is a critical failure - the branch MUST be created for Claude to work
throw new Error( throw new Error(
`Failed to create branch ${newBranch}: ${gitError.message}`, `Failed to create branch ${newBranch}: ${gitError.message || gitError}`,
); );
} }