@ -93,6 +93,9 @@ function buildBranchCommits(git, base, branch) {
for ( const sha of shas ) {
const commit = yield git . getCommit ( sha ) ;
commits . push ( commit ) ;
for ( const unparsedChange of commit . unparsedChanges ) {
core . warning ( ` Skipping unexpected diff entry: ${ unparsedChange } ` ) ;
}
}
return commits ;
} ) ;
@ -715,13 +718,13 @@ class GitCommandManager {
'show' ,
'--raw' ,
'--cc' ,
'--diff-filter=AMD' ,
` --format=%H%n%T%n%P%n%G?%n%s%n%b%n ${ endOfBody } ` ,
ref
] ) ;
const lines = output . stdout . split ( '\n' ) ;
const endOfBodyIndex = lines . lastIndexOf ( endOfBody ) ;
const detailLines = lines . slice ( 0 , endOfBodyIndex ) ;
const unparsedChanges = [ ] ;
return {
sha : detailLines [ 0 ] ,
tree : detailLines [ 1 ] ,
@ -739,9 +742,10 @@ class GitCommandManager {
} ;
}
else {
throw new Error ( ` Unexpected line format: ${ line } ` ) ;
unparsedChanges . push ( line ) ;
}
} )
} ) ,
unparsedChanges : unparsedChanges
} ;
} ) ;
}
@ -33504,9 +33508,23 @@ const kWeight = Symbol('kWeight')
const kMaxWeightPerServer = Symbol ( 'kMaxWeightPerServer' )
const kErrorPenalty = Symbol ( 'kErrorPenalty' )
/ * *
* Calculate the greatest common divisor of two numbers by
* using the Euclidean algorithm .
*
* @ param { number } a
* @ param { number } b
* @ returns { number }
* /
function getGreatestCommonDivisor ( a , b ) {
if ( b === 0 ) return a
return getGreatestCommonDivisor ( b , a % b )
if ( a === 0 ) return b
while ( b !== 0 ) {
const t = b
b = a % b
a = t
}
return a
}
function defaultFactory ( origin , opts ) {
@ -33584,7 +33602,12 @@ class BalancedPool extends PoolBase {
}
_updateBalancedPoolStats ( ) {
this [ kGreatestCommonDivisor ] = this [ kClients ] . map ( p => p [ kWeight ] ) . reduce ( getGreatestCommonDivisor , 0 )
let result = 0
for ( let i = 0 ; i < this [ kClients ] . length ; i ++ ) {
result = getGreatestCommonDivisor ( this [ kClients ] [ i ] [ kWeight ] , result )
}
this [ kGreatestCommonDivisor ] = result
}
removeUpstream ( upstream ) {
@ -42771,12 +42794,25 @@ const { kState } = __nccwpck_require__(749)
const { webidl } = _ _nccwpck _require _ _ ( 4890 )
const { Blob } = _ _nccwpck _require _ _ ( 2254 )
const assert = _ _nccwpck _require _ _ ( 8061 )
const { isErrored } = _ _nccwpck _require _ _ ( 3983 )
const { isErrored , isDisturbed } = _ _nccwpck _require _ _ ( 4492 )
const { isArrayBuffer } = _ _nccwpck _require _ _ ( 3746 )
const { serializeAMimeType } = _ _nccwpck _require _ _ ( 7704 )
const { multipartFormDataParser } = _ _nccwpck _require _ _ ( 7991 )
const textEncoder = new TextEncoder ( )
function noop ( ) { }
const hasFinalizationRegistry = globalThis . FinalizationRegistry && process . version . indexOf ( 'v18' ) !== 0
let streamRegistry
if ( hasFinalizationRegistry ) {
streamRegistry = new FinalizationRegistry ( ( weakRef ) => {
const stream = weakRef . deref ( )
if ( stream && ! stream . locked && ! isDisturbed ( stream ) && ! isErrored ( stream ) ) {
stream . cancel ( 'Response object has been garbage collected' ) . catch ( noop )
}
} )
}
// https://fetch.spec.whatwg.org/#concept-bodyinit-extract
function extractBody ( object , keepalive = false ) {
@ -43019,7 +43055,7 @@ function safelyExtractBody (object, keepalive = false) {
return extractBody ( object , keepalive )
}
function cloneBody ( body ) {
function cloneBody ( instance , body) {
// To clone a body body, run these steps:
// https://fetch.spec.whatwg.org/#concept-body-clone
@ -43027,6 +43063,10 @@ function cloneBody (body) {
// 1. Let « out1, out2 » be the result of teeing body’ s stream.
const [ out1 , out2 ] = body . stream . tee ( )
if ( hasFinalizationRegistry ) {
streamRegistry . register ( instance , new WeakRef ( out1 ) )
}
// 2. Set body’ s stream to out1.
body . stream = out1
@ -43169,7 +43209,7 @@ async function consumeBody (object, convertBytesToJSValue, instance) {
// 1. If object is unusable, then return a promise rejected
// with a TypeError.
if ( bodyUnusable ( object [ kState ] . body )) {
if ( bodyUnusable ( object ) ) {
throw new TypeError ( 'Body is unusable: Body has already been read' )
}
@ -43209,7 +43249,9 @@ async function consumeBody (object, convertBytesToJSValue, instance) {
}
// https://fetch.spec.whatwg.org/#body-unusable
function bodyUnusable ( body ) {
function bodyUnusable ( object ) {
const body = object [ kState ] . body
// An object including the Body interface mixin is
// said to be unusable if its body is non-null and
// its body’ s stream is disturbed or locked.
@ -43251,7 +43293,10 @@ module.exports = {
extractBody ,
safelyExtractBody ,
cloneBody ,
mixinBody
mixinBody ,
streamRegistry ,
hasFinalizationRegistry ,
bodyUnusable
}
@ -48061,7 +48106,7 @@ module.exports = {
const { extractBody , mixinBody , cloneBody } = _ _nccwpck _require _ _ ( 6682 )
const { extractBody , mixinBody , cloneBody , bodyUnusable } = _ _nccwpck _require _ _ ( 6682 )
const { Headers , fill : fillHeaders , HeadersList , setHeadersGuard , getHeadersGuard , setHeadersList , getHeadersList } = _ _nccwpck _require _ _ ( 2991 )
const { FinalizationRegistry } = _ _nccwpck _require _ _ ( 1922 ) ( )
const util = _ _nccwpck _require _ _ ( 3983 )
@ -48616,7 +48661,7 @@ class Request {
// 40. If initBody is null and inputBody is non-null, then:
if ( initBody == null && inputBody != null ) {
// 1. If input is unusable, then throw a TypeError.
if ( util . isDisturbed ( inputBody . stream ) || inputBody . stream . locked ) {
if ( bodyUnusable ( input ) ) {
throw new TypeError (
'Cannot construct a Request with a Request object that has already been used.'
)
@ -48818,7 +48863,7 @@ class Request {
webidl . brandCheck ( this , Request )
// 1. If this is unusable, then throw a TypeError.
if ( this . bodyUsed || this . body ? . locked ) {
if ( bodyUnusable ( this ) ) {
throw new TypeError ( 'unusable' )
}
@ -48936,7 +48981,7 @@ function cloneRequest (request) {
// 2. If request’ s body is non-null, set newRequest’ s body to the
// result of cloning request’ s body.
if ( request . body != null ) {
newRequest . body = cloneBody ( request . body )
newRequest . body = cloneBody ( newRequest , request. body )
}
// 3. Return newRequest.
@ -49104,7 +49149,7 @@ module.exports = { Request, makeRequest, fromInnerRequest, cloneRequest }
const { Headers , HeadersList , fill , getHeadersGuard , setHeadersGuard , setHeadersList } = _ _nccwpck _require _ _ ( 2991 )
const { extractBody , cloneBody , mixinBody } = _ _nccwpck _require _ _ ( 6682 )
const { extractBody , cloneBody , mixinBody , hasFinalizationRegistry , streamRegistry , bodyUnusable } = _ _nccwpck _require _ _ ( 6682 )
const util = _ _nccwpck _require _ _ ( 3983 )
const nodeUtil = _ _nccwpck _require _ _ ( 7261 )
const { kEnumerableProperty } = util
@ -49129,24 +49174,9 @@ const { URLSerializer } = __nccwpck_require__(7704)
const { kConstruct } = _ _nccwpck _require _ _ ( 2785 )
const assert = _ _nccwpck _require _ _ ( 8061 )
const { types } = _ _nccwpck _require _ _ ( 7261 )
const { isDisturbed , isErrored } = _ _nccwpck _require _ _ ( 4492 )
const textEncoder = new TextEncoder ( 'utf-8' )
const hasFinalizationRegistry = globalThis . FinalizationRegistry && process . version . indexOf ( 'v18' ) !== 0
let registry
if ( hasFinalizationRegistry ) {
registry = new FinalizationRegistry ( ( weakRef ) => {
const stream = weakRef . deref ( )
if ( stream && ! stream . locked && ! isDisturbed ( stream ) && ! isErrored ( stream ) ) {
stream . cancel ( 'Response object has been garbage collected' ) . catch ( noop )
}
} )
}
function noop ( ) { }
// https://fetch.spec.whatwg.org/#response-class
class Response {
// Creates network error Response.
@ -49347,7 +49377,7 @@ class Response {
webidl . brandCheck ( this , Response )
// 1. If this is unusable, then throw a TypeError.
if ( this . bodyUsed || this . body ? . locked ) {
if ( bodyUnusable ( this ) ) {
throw webidl . errors . exception ( {
header : 'Response.clone' ,
message : 'Body has already been consumed.'
@ -49430,7 +49460,7 @@ function cloneResponse (response) {
// 3. If response’ s body is non-null, then set newResponse’ s body to the
// result of cloning response’ s body.
if ( response . body != null ) {
newResponse . body = cloneBody ( response . body )
newResponse . body = cloneBody ( newResponse , response. body )
}
// 4. Return newResponse.
@ -49635,7 +49665,7 @@ function fromInnerResponse (innerResponse, guard) {
// a primitive or an object, even undefined. If the held value is an object, the registry keeps
// a strong reference to it (so it can pass it to the cleanup callback later). Reworded from
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry
r egistry. register ( response , new WeakRef ( innerResponse . body . stream ) )
streamR egistry. register ( response , new WeakRef ( innerResponse . body . stream ) )
}
return response