no need to re-checkout brave-core since we won't be using gclient to manage git checkout for it anymore

This commit is contained in:
Pete Miller 2021-12-09 21:05:38 -08:00 committed by Pete Miller (Rebase PR Action)
parent 3d1320b221
commit ec5614218b

View File

@ -20,20 +20,8 @@ if (!fs.existsSync(path.join(braveCoreDir, '.git'))) {
util.runGit(braveCoreDir, ['clone', util.getNPMConfig(['projects', 'brave-core', 'repository', 'url']), '.']) util.runGit(braveCoreDir, ['clone', util.getNPMConfig(['projects', 'brave-core', 'repository', 'url']), '.'])
util.runGit(braveCoreDir, ['checkout', braveCoreRef]) util.runGit(braveCoreDir, ['checkout', braveCoreRef])
} }
// re-checkout as the commit ref because otherwise gclient sync clobbers
// the branch for braveCoreRef and doesn't set it to the correct commit
// for some reason
const braveCoreSha = util.runGit(braveCoreDir, ['rev-parse', 'HEAD']) const braveCoreSha = util.runGit(braveCoreDir, ['rev-parse', 'HEAD'])
Log.progress(`Resetting brave core to "${braveCoreSha}"...`) Log.progress(`brave-core repo at ${braveCoreDir} is at commit ID ${braveCoreSha}`)
util.runGit(braveCoreDir, ['reset', '--hard', 'HEAD'], true)
let checkoutResult = util.runGit(braveCoreDir, ['checkout', braveCoreSha], true)
// Handle checkout failure
if (checkoutResult === null) {
Log.error('Could not checkout: ' + braveCoreSha)
}
// Checkout was successful
Log.progress(`...brave core is now at commit ID ${braveCoreSha}`)
let npmCommand = 'npm' let npmCommand = 'npm'
if (process.platform === 'win32') { if (process.platform === 'win32') {