History

fix: use 'push' instead of 'commit_push' for clean working tree on default branch

When isDefaultBranch is true and there are no working tree changes, resolveQuickAction was returning action 'commit_push' instead of 'push'. This caused unnecessary commit resolution steps (staging, diff context, AI commit message generation) only to discover there's nothing to commit. The dedicated 'push' action was introduced precisely for this case and requiresDefaultBranchConfirmation already handles it correctly.

Cursor Agent committed 7 months ago

Commit c2725621 parent c0c8c5c2 files · +4 −4Browse files

Unified · Split

2 files
  1. apps/web/src/components/GitActionsControl.logic.test.ts +2 −2
  2. apps/web/src/components/GitActionsControl.logic.ts +2 −2
apps/web/src/components/GitActionsControl.logic.test.ts+2−2
@@ -440,7 +440,7 @@ describe("when: on default branch without open PR", () => { · 439 unmodified lines
440 );440 );
441 assert.deepInclude(quick, {441 assert.deepInclude(quick, {
442 kind: "run_action",442 kind: "run_action",
443 action: "commit_push",443 action: "push",
444 label: "Push",444 label: "Push",
445 disabled: false,445 disabled: false,
446 });446 });
@@ -754,7 +754,7 @@ describe("when: branch has no upstream configured", () => { · 307 unmodified lines
754 );754 );
755 assert.deepInclude(quick, {755 assert.deepInclude(quick, {
756 kind: "run_action",756 kind: "run_action",
757 action: "commit_push",757 action: "push",
758 label: "Push",758 label: "Push",
759 disabled: false,759 disabled: false,
760 });760 });
apps/web/src/components/GitActionsControl.logic.ts+2−2
@@ -214,7 +214,7 @@ export function resolveQuickAction( · 213 unmodified lines
214 label: "Push",214 label: "Push",
215 disabled: false,215 disabled: false,
216 kind: "run_action",216 kind: "run_action",
217 action: isDefaultBranch ? "commit_push" : "push",217 action: "push",
218 };218 };
219 }219 }
220 return {220 return {
@@ -248,7 +248,7 @@ export function resolveQuickAction( · 27 unmodified lines
248 label: "Push",248 label: "Push",
249 disabled: false,249 disabled: false,
250 kind: "run_action",250 kind: "run_action",
251 action: isDefaultBranch ? "commit_push" : "push",251 action: "push",
252 };252 };
253 }253 }
254 return {254 return {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t