File tree Expand file tree Collapse file tree
packages/vscode/src/views/panel/backend/message-handlers/handle-commit-changes/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,12 +43,17 @@ export const build_commit_message_prompt = (
4343 ? new_path_line . substring ( '+++ b/' . length )
4444 : undefined
4545
46+ let final_diff_content = full_file_diff
47+
4648 let file_path : string | undefined
4749
4850 if ( new_path && new_path != '/dev/null' ) {
4951 file_path = new_path
5052 } else if ( old_path && old_path != '/dev/null' ) {
5153 file_path = old_path
54+ // Shorten diff of a deleted file
55+ const split_diff = full_file_diff . split ( '+++ /dev/null' )
56+ final_diff_content = split_diff [ 0 ] + '+++ /dev/null'
5257 }
5358
5459 if ( file_path ) {
@@ -59,7 +64,7 @@ export const build_commit_message_prompt = (
5964 if ( file_data ) {
6065 changes_content += `The original state of the file for reference:\n\n<![CDATA[\n${ file_data . content } \n]]>\n\n`
6166 }
62- changes_content += `**New changes:**\n\n<![CDATA[\n${ full_file_diff } \n]]>\n`
67+ changes_content += `**New changes:**\n\n<![CDATA[\n${ final_diff_content } \n]]>\n`
6368 }
6469 }
6570
You can’t perform that action at this time.
0 commit comments