mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-08 15:55:15 +01:00
Enhance git sync command to include worktree URI for better context
This commit is contained in:
@@ -81,13 +81,13 @@ export class SyncIndicator extends Disposable {
|
||||
|
||||
this._renderDisposables.add(dom.addDisposableListener(button, dom.EventType.CLICK, (e) => {
|
||||
dom.EventHelper.stop(e, true);
|
||||
this.commandService.executeCommand(GIT_SYNC_COMMAND);
|
||||
this.commandService.executeCommand(GIT_SYNC_COMMAND, this._repository?.rootUri);
|
||||
}));
|
||||
|
||||
this._renderDisposables.add(dom.addDisposableListener(button, dom.EventType.KEY_DOWN, (e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
dom.EventHelper.stop(e, true);
|
||||
this.commandService.executeCommand(GIT_SYNC_COMMAND);
|
||||
this.commandService.executeCommand(GIT_SYNC_COMMAND, this._repository?.rootUri);
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
@@ -112,7 +112,9 @@ function registerSyncAction(behind: number, ahead: number): IDisposable {
|
||||
|
||||
override async run(accessor: ServicesAccessor): Promise<void> {
|
||||
const commandService = accessor.get(ICommandService);
|
||||
await commandService.executeCommand('git.sync');
|
||||
const sessionManagementService = accessor.get(ISessionsManagementService);
|
||||
const worktreeUri = sessionManagementService.getActiveSession()?.worktree;
|
||||
await commandService.executeCommand('git.sync', worktreeUri);
|
||||
}
|
||||
}
|
||||
return registerAction2(SynchronizeChangesAction);
|
||||
|
||||
Reference in New Issue
Block a user