@snapcommit/cli 3.9.5 → 3.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -87,7 +87,7 @@ async function handleAICommand(userInput) {
|
|
|
87
87
|
// Commit/push flow
|
|
88
88
|
if (intent.action === 'commit' || intent.action === 'push' ||
|
|
89
89
|
(intent.gitCommands && intent.gitCommands.some((cmd) => cmd.includes('commit')))) {
|
|
90
|
-
await executeCommitWithAI(intent);
|
|
90
|
+
await executeCommitWithAI(intent, userInput);
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
93
|
// Other git commands (branch, merge, etc.)
|
|
@@ -131,7 +131,7 @@ async function showStatus() {
|
|
|
131
131
|
* Execute commit - EXACTLY like Cursor!
|
|
132
132
|
* Minimal friction, one prompt, instant feel
|
|
133
133
|
*/
|
|
134
|
-
async function executeCommitWithAI(intent) {
|
|
134
|
+
async function executeCommitWithAI(intent, originalInput = '') {
|
|
135
135
|
const status = (0, git_1.getGitStatus)();
|
|
136
136
|
const hasChanges = status.staged > 0 || status.unstaged > 0 || status.untracked > 0;
|
|
137
137
|
// Check if there are unpushed commits (even if working tree is clean)
|
|
@@ -324,9 +324,10 @@ async function executeCommitWithAI(intent) {
|
|
|
324
324
|
console.log(chalk_1.default.red(`\n❌ Commit failed: ${error.message}\n`));
|
|
325
325
|
return;
|
|
326
326
|
}
|
|
327
|
-
// Push if requested (
|
|
327
|
+
// Push if requested (ALWAYS push when user says "push", even if AI just says "commit")
|
|
328
328
|
const shouldPush = intent.shouldPush ||
|
|
329
329
|
intent.action === 'push' ||
|
|
330
|
+
originalInput.toLowerCase().includes('push') ||
|
|
330
331
|
intent.gitCommands?.some((cmd) => cmd.includes('push'));
|
|
331
332
|
if (shouldPush) {
|
|
332
333
|
// STEP 1: Pull first to avoid conflicts (like Cursor does!)
|