File tree Expand file tree Collapse file tree
commands/generate-commit-message-command Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export const generate_commit_message_command = (
2121 const working_tree_changes = repository . state . workingTreeChanges || [ ]
2222 const is_single_change = was_empty_stage && working_tree_changes . length == 1
2323
24- const diff = await prepare_staged_changes ( repository )
24+ const diff = await prepare_staged_changes ( repository , ! ! source_control )
2525
2626 if ( ! diff ) return null
2727
@@ -55,7 +55,8 @@ export const generate_commit_message_command = (
5555 await api_providers_manager . get_default_commit_messages_config ( )
5656 const has_default_config = ! ! default_config
5757
58- const show_back_button = was_empty_stage && ! is_single_change_flow
58+ const show_back_button =
59+ was_empty_stage && ! is_single_change_flow && ! source_control
5960
6061 const api_config_data = await get_commit_message_config (
6162 context ,
Original file line number Diff line number Diff line change @@ -87,7 +87,8 @@ export const get_git_repository = async (
8787}
8888
8989export const prepare_staged_changes = async (
90- repository : GitRepository
90+ repository : GitRepository ,
91+ stage_all_if_none_staged : boolean = false
9192) : Promise < string | null > => {
9293 await repository . status ( )
9394 const staged_changes = repository . state . indexChanges || [ ]
@@ -98,7 +99,11 @@ export const prepare_staged_changes = async (
9899 ) {
99100 let files_to_stage : string [ ] = [ ]
100101
101- if ( repository . state . workingTreeChanges . length == 1 ) {
102+ if ( stage_all_if_none_staged ) {
103+ files_to_stage = repository . state . workingTreeChanges . map (
104+ ( change : any ) => change . uri . fsPath
105+ )
106+ } else if ( repository . state . workingTreeChanges . length == 1 ) {
102107 files_to_stage = [ repository . state . workingTreeChanges [ 0 ] . uri . fsPath ]
103108 } else {
104109 const items = repository . state . workingTreeChanges . map ( ( change : any ) => {
You can’t perform that action at this time.
0 commit comments