fix(ide): apply package commit to existing runtime and record actual installed revision
This commit is contained in:
@@ -111,16 +111,16 @@ function resolveMarkerPinnedCommit(
|
||||
): string | null {
|
||||
const resolveHead = opts.resolveHead || resolveCheckoutHead
|
||||
|
||||
if (installStamp && isPinnedCommit(installStamp.commit)) {
|
||||
return installStamp.commit
|
||||
}
|
||||
|
||||
const head = resolveHead(activeRoot)
|
||||
|
||||
if (head) {
|
||||
return head
|
||||
}
|
||||
|
||||
if (installStamp && isPinnedCommit(installStamp.commit)) {
|
||||
return installStamp.commit
|
||||
}
|
||||
|
||||
return readExistingPinnedCommit(activeRoot)
|
||||
}
|
||||
|
||||
@@ -918,14 +918,14 @@ async function runBootstrap(opts) {
|
||||
|
||||
try {
|
||||
const existingCheckout = hasExistingGitCheckout(activeRoot)
|
||||
const pinCommit = !existingCheckout
|
||||
const pinCommit = Boolean(installStamp && isPinnedCommit(installStamp.commit)) || !existingCheckout
|
||||
|
||||
if (existingCheckout && installStamp && installStamp.commit) {
|
||||
emit({
|
||||
type: 'log',
|
||||
line:
|
||||
`[bootstrap] existing checkout detected at ${activeRoot}; ` +
|
||||
`not pinning to packaged install stamp ${installStamp.commit.slice(0, 12)}`
|
||||
`applying packaged install stamp ${installStamp.commit.slice(0, 12)} with installer rollback protection`
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1002,6 +1002,7 @@ async function runBootstrap(opts) {
|
||||
|
||||
const markerPayload = {
|
||||
pinnedCommit,
|
||||
packageCommit: installStamp && isPinnedCommit(installStamp.commit) ? installStamp.commit : null,
|
||||
pinnedBranch: installStamp ? installStamp.branch : null
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user