authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-03-02 19:29:25-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-03-02 20:46:05-08:00
log30e05538b797ea4d1df34d21332ea471142874b7
tree8be8d25fdfd504b1345d4eb9caa255d0e28136ff
parentc884947ea8ce16d6cc01aeff2479d5285ac1f397

Limit default-branch confirmation to direct push

- Stop showing default-branch confirmation for `commit_push_pr` - Keep confirmation only for direct `commit_push` actions - Update logic test to match the new behavior

2 files changed, 3 insertions(+), 3 deletions(-)

apps/web/src/components/GitActionsControl.logic.test.ts+2-2
...@@ -737,10 +737,10 @@ describe("when: branch has no upstream configured", () => {...@@ -737,10 +737,10 @@ describe("when: branch has no upstream configured", () => {
737});737});
738738
739describe("requiresDefaultBranchConfirmation", () => {739describe("requiresDefaultBranchConfirmation", () => {
740 it("requires confirmation only for push actions on default branch", () => {740 it("requires confirmation only for direct push on default branch", () => {
741 assert.isFalse(requiresDefaultBranchConfirmation("commit", true));741 assert.isFalse(requiresDefaultBranchConfirmation("commit", true));
742 assert.isTrue(requiresDefaultBranchConfirmation("commit_push", true));742 assert.isTrue(requiresDefaultBranchConfirmation("commit_push", true));
743 assert.isTrue(requiresDefaultBranchConfirmation("commit_push_pr", true));743 assert.isFalse(requiresDefaultBranchConfirmation("commit_push_pr", true));
744 assert.isFalse(requiresDefaultBranchConfirmation("commit_push", false));744 assert.isFalse(requiresDefaultBranchConfirmation("commit_push", false));
745 });745 });
746});746});
apps/web/src/components/GitActionsControl.logic.ts+1-1
...@@ -282,7 +282,7 @@ export function requiresDefaultBranchConfirmation(...@@ -282,7 +282,7 @@ export function requiresDefaultBranchConfirmation(
282 isDefaultBranch: boolean,282 isDefaultBranch: boolean,
283): boolean {283): boolean {
284 if (!isDefaultBranch) return false;284 if (!isDefaultBranch) return false;
285 return action === "commit_push" || action === "commit_push_pr";285 return action === "commit_push";
286}286}
287287
288export function resolveDefaultBranchActionDialogCopy(input: {288export function resolveDefaultBranchActionDialogCopy(input: {