You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// error preserves the "incremental" contract that the patch reflects only
300
313
// the new commits.
301
314
if(!patchGenerated&&mode==="incremental"){
302
-
debugLog(`Strategy 1 (incremental): format-patch produced no output for ${baseRef}..${branchName} despite ${commitCount} incremental commit(s), refusing to fall through to checkout-base strategies`);
315
+
debugLog(`Strategy 1 (incremental): format-patch produced no output for ${baseRef}..${tipRef} despite ${commitCount} incremental commit(s), refusing to fall through to checkout-base strategies`);
303
316
return{
304
317
success: false,
305
-
error: `Cannot generate incremental patch: git format-patch produced no output for ${baseRef}..${branchName} despite ${commitCount} incremental commit(s).`,
318
+
error: `Cannot generate incremental patch: git format-patch produced no output for ${baseRef}..${tipRef} despite ${commitCount} incremental commit(s).`,
306
319
patchPath: patchPath,
307
320
};
308
321
}
309
322
}catch(branchError){
310
-
// Branch does not exist locally
323
+
// Branch does not exist locally (or pinnedSha failed)
311
324
debugLog(`Strategy 1: Branch '${branchName}' does not exist locally - ${getErrorMessage(branchError)}`);
325
+
if(options.pinnedSha){
326
+
// SECURITY: When pinnedSha is set, fail closed — do not fall through to
327
+
// other strategies that would resolve a different commit.
328
+
return{
329
+
success: false,
330
+
error: `Pinned SHA ${options.pinnedSha} failed to generate patch: ${getErrorMessage(branchError)}`,
// baseCommitSha is not an ancestor of branchName (rebase / force-push)
534
-
debugLog(`Strategy 1 (incremental): baseCommitSha ${baseCommitSha} is not an ancestor of ${branchName} (rebase/force-push?); skipping merge-base adjustment`);
555
+
// baseCommitSha is not an ancestor of tipRef (rebase / force-push)
556
+
debugLog(`Strategy 1 (incremental): baseCommitSha ${baseCommitSha} is not an ancestor of ${resolvedTipRef} (rebase/force-push?); skipping merge-base adjustment`);
0 commit comments