Skip to content

Commit 664c4e3

Browse files
committed
Pass repository to git.unstageAll command calls
- when cancelling a commit message generation, user is shown a list of repositories in the multi-root folder workspace even though there is only one repository with changes to commit
1 parent cfce4e3 commit 664c4e3

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

‎apps/editor/src/commands/generate-commit-message-command/generate-commit-message-command.ts‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ export const generate_commit_message_command = (
107107
if (api_configuration_data == 'back') {
108108
if (was_empty_stage) {
109109
if (!show_back_button) {
110-
await vscode.commands.executeCommand('git.unstageAll')
110+
await vscode.commands.executeCommand('git.unstageAll', repository)
111111
return
112112
}
113113

114-
await vscode.commands.executeCommand('git.unstageAll')
114+
await vscode.commands.executeCommand('git.unstageAll', repository)
115115
files_staged_by_action = false
116116
continue
117117
}
@@ -120,7 +120,7 @@ export const generate_commit_message_command = (
120120

121121
if (!api_configuration_data) {
122122
if (was_empty_stage) {
123-
await vscode.commands.executeCommand('git.unstageAll')
123+
await vscode.commands.executeCommand('git.unstageAll', repository)
124124
}
125125
return
126126
}
@@ -249,7 +249,10 @@ export const generate_commit_message_command = (
249249

250250
if (picked === undefined) {
251251
if (was_empty_stage) {
252-
await vscode.commands.executeCommand('git.unstageAll')
252+
await vscode.commands.executeCommand(
253+
'git.unstageAll',
254+
repository
255+
)
253256
}
254257
break
255258
}
@@ -287,7 +290,7 @@ export const generate_commit_message_command = (
287290
silent: true
288291
}).catch(() => {})
289292
} else if (was_empty_stage) {
290-
await vscode.commands.executeCommand('git.unstageAll')
293+
await vscode.commands.executeCommand('git.unstageAll', repository)
291294
}
292295
} else {
293296
const prompts_text =
@@ -342,7 +345,7 @@ export const generate_commit_message_command = (
342345
)
343346

344347
if (was_empty_stage) {
345-
await vscode.commands.executeCommand('git.unstageAll')
348+
await vscode.commands.executeCommand('git.unstageAll', repository)
346349
}
347350
}
348351
)

0 commit comments

Comments
 (0)