Scope default-branch PR confirmation to full stack
Co-authored-by: codex <[email protected]>
This commit is contained in:
1 parent
b2be7f4e4f
commit
e4df6fcf8e
3 files changed
+5
-3
No files matched your search
@@ -737,10 +737,10 @@ describe("when: branch has no upstream configured", () => {
|
||||
});
|
||||
|
||||
describe("requiresDefaultBranchConfirmation", () => {
|
||||
it("requires confirmation only for direct push on default branch", () => {
|
||||
it("requires confirmation for push actions on default branch", () => {
|
||||
assert.isFalse(requiresDefaultBranchConfirmation("commit", true));
|
||||
assert.isTrue(requiresDefaultBranchConfirmation("commit_push", true));
|
||||
assert.isFalse(requiresDefaultBranchConfirmation("commit_push_pr", true));
|
||||
assert.isTrue(requiresDefaultBranchConfirmation("commit_push_pr", true));
|
||||
assert.isFalse(requiresDefaultBranchConfirmation("commit_push", false));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -282,7 +282,7 @@ export function requiresDefaultBranchConfirmation(
|
||||
isDefaultBranch: boolean,
|
||||
): boolean {
|
||||
if (!isDefaultBranch) return false;
|
||||
return action === "commit_push";
|
||||
return action === "commit_push" || action === "commit_push_pr";
|
||||
}
|
||||
|
||||
export function resolveDefaultBranchActionDialogCopy(input: {
|
||||
|
||||
@@ -347,6 +347,7 @@ export default function GitActionsControl({ gitCwd, activeThreadId }: GitActions
|
||||
action: "commit_push",
|
||||
forcePushOnlyProgress: true,
|
||||
onConfirmed: closeResultToast,
|
||||
featureBranch,
|
||||
});
|
||||
},
|
||||
},
|
||||
@@ -372,6 +373,7 @@ export default function GitActionsControl({ gitCwd, activeThreadId }: GitActions
|
||||
void runGitActionWithToast({
|
||||
action: "commit_push_pr",
|
||||
forcePushOnlyProgress: true,
|
||||
featureBranch,
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user