File tree Expand file tree Collapse file tree
src/utils/replace-changes-placeholder Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " gemini-coder" ,
33 "displayName" : " Code Web Chat (CWC)" ,
4- "description" : " Initialize your favorite chatbot, then apply the response with a single click " ,
5- "version" : " 1.149 .0" ,
4+ "description" : " Connect your editor with 10+ chatbots " ,
5+ "version" : " 1.150 .0" ,
66 "scripts" : {
77 "build" : " npx vsce package --no-dependencies" ,
88 "vscode:prepublish" : " npm run compile" ,
Original file line number Diff line number Diff line change @@ -35,7 +35,14 @@ export const replace_changes_placeholder = async (
3535 }
3636
3737 try {
38- const diff = execSync ( `git diff ${ branch_name } ` , {
38+ // Get current branch name
39+ const current_branch = execSync ( 'git rev-parse --abbrev-ref HEAD' , {
40+ cwd : target_folder . uri . fsPath
41+ } ) . toString ( ) . trim ( )
42+
43+ // If comparing to same branch, use merge-base to show changes since branch point
44+ const diff_command = current_branch == branch_name ? `git diff $(git merge-base HEAD origin/${ branch_name } )` : `git diff ${ branch_name } `
45+ const diff = execSync ( diff_command , {
3946 cwd : target_folder . uri . fsPath
4047 } ) . toString ( )
4148
@@ -74,7 +81,14 @@ export const replace_changes_placeholder = async (
7481 }
7582
7683 try {
77- const diff = execSync ( `git diff ${ branch_name } ` , {
84+ // Get current branch name
85+ const current_branch = execSync ( 'git rev-parse --abbrev-ref HEAD' , {
86+ cwd : repository . rootUri . fsPath
87+ } ) . toString ( ) . trim ( )
88+
89+ // If comparing to same branch, use merge-base to show changes since branch point
90+ const diff_command = current_branch == branch_name ? `git diff $(git merge-base HEAD origin/${ branch_name } )` : `git diff ${ branch_name } `
91+ const diff = execSync ( diff_command , {
7892 cwd : repository . rootUri . fsPath
7993 } ) . toString ( )
8094
You can’t perform that action at this time.
0 commit comments