Skip to content

Commit a45cc3c

Browse files
authored
Merge pull request microsoft#298328 from microsoft/copilot-worktree-2026-02-27T18-24-47
Sessions window: git sync command with worktree URI
2 parents 0e26d29 + 7a92c70 commit a45cc3c

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/vs/sessions/contrib/chat/browser/syncIndicator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ export class SyncIndicator extends Disposable {
8181

8282
this._renderDisposables.add(dom.addDisposableListener(button, dom.EventType.CLICK, (e) => {
8383
dom.EventHelper.stop(e, true);
84-
this.commandService.executeCommand(GIT_SYNC_COMMAND);
84+
this.commandService.executeCommand(GIT_SYNC_COMMAND, this._repository?.rootUri);
8585
}));
8686

8787
this._renderDisposables.add(dom.addDisposableListener(button, dom.EventType.KEY_DOWN, (e) => {
8888
if (e.key === 'Enter' || e.key === ' ') {
8989
dom.EventHelper.stop(e, true);
90-
this.commandService.executeCommand(GIT_SYNC_COMMAND);
90+
this.commandService.executeCommand(GIT_SYNC_COMMAND, this._repository?.rootUri);
9191
}
9292
}));
9393

src/vs/sessions/contrib/gitSync/browser/gitSync.contribution.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ function registerSyncAction(behind: number, ahead: number): IDisposable {
112112

113113
override async run(accessor: ServicesAccessor): Promise<void> {
114114
const commandService = accessor.get(ICommandService);
115-
await commandService.executeCommand('git.sync');
115+
const sessionManagementService = accessor.get(ISessionsManagementService);
116+
const worktreeUri = sessionManagementService.getActiveSession()?.worktree;
117+
await commandService.executeCommand('git.sync', worktreeUri);
116118
}
117119
}
118120
return registerAction2(SynchronizeChangesAction);

0 commit comments

Comments
 (0)