@@ -180,7 +180,7 @@ const subcommandToTitleMap = new Map<State['subcommand'] | undefined, string>([
180
180
[ 'create' , `Create Worktree` ] ,
181
181
[ 'delete' , `Delete Worktrees` ] ,
182
182
[ 'open' , `Open Worktree` ] ,
183
- [ 'copy-changes' , 'Copy Changes to' ] ,
183
+ [ 'copy-changes' , 'Copy Changes to Worktree ' ] ,
184
184
] ) ;
185
185
function getTitle ( subcommand : State [ 'subcommand' ] | undefined , suffix ?: string ) {
186
186
return `${ subcommandToTitleMap . get ( subcommand ) } ${ suffix ?? '' } ` ;
@@ -1153,12 +1153,15 @@ export class WorktreeGitCommand extends QuickCommand<State> {
1153
1153
let placeholder ;
1154
1154
switch ( state . changes . type ) {
1155
1155
case 'index' :
1156
+ context . title = state ?. overrides ?. title ?? 'Copy Staged Changes to Worktree' ;
1156
1157
placeholder = 'Choose a worktree to copy your staged changes to' ;
1157
1158
break ;
1158
1159
case 'working-tree' :
1160
+ context . title = state ?. overrides ?. title ?? 'Copy Working Changes to Worktree' ;
1159
1161
placeholder = 'Choose a worktree to copy your working changes to' ;
1160
1162
break ;
1161
1163
default :
1164
+ context . title = state ?. overrides ?. title ?? 'Copy Changes to Worktree' ;
1162
1165
placeholder = 'Choose a worktree to copy changes to' ;
1163
1166
break ;
1164
1167
}
@@ -1193,9 +1196,9 @@ export class WorktreeGitCommand extends QuickCommand<State> {
1193
1196
}
1194
1197
1195
1198
if ( ! isSha ( state . changes . baseSha ) ) {
1196
- const commit = await state . repo . git . commits ( ) . getCommit ( state . changes . baseSha ) ;
1197
- if ( commit != null ) {
1198
- state . changes . baseSha = commit . sha ;
1199
+ const sha = await state . repo . git . resolveReference ( state . changes . baseSha , undefined , { force : true } ) ;
1200
+ if ( sha != null ) {
1201
+ state . changes . baseSha = sha ;
1199
1202
}
1200
1203
}
1201
1204
@@ -1207,7 +1210,7 @@ export class WorktreeGitCommand extends QuickCommand<State> {
1207
1210
endSteps ( state ) ;
1208
1211
1209
1212
try {
1210
- const patchProvider = this . container . git . patch ( state . worktree . repoPath ) ;
1213
+ const patchProvider = this . container . git . patch ( state . worktree . uri ) ;
1211
1214
const commit = await patchProvider ?. createUnreachableCommitForPatch (
1212
1215
state . changes . contents ,
1213
1216
state . changes . baseSha ,
0 commit comments