Git - accept working set changes when a resource is staged/committed (#262885)

This commit is contained in:
Ladislau Szomoru
2025-08-25 15:07:51 +00:00
committed by GitHub
parent 6507095eee
commit a63acf5e40
2 changed files with 27 additions and 1 deletions

View File

@@ -1223,6 +1223,9 @@ export class Repository implements Disposable {
async () => {
await this.repository.add(resources.map(r => r.fsPath), opts);
this.closeDiffEditors([], [...resources.map(r => r.fsPath)]);
// Accept working set changes across all chat sessions
commands.executeCommand('_chat.editSessions.accept', resources);
},
() => {
const resourcePaths = resources.map(r => r.fsPath);
@@ -1373,6 +1376,12 @@ export class Repository implements Disposable {
this.inputBox.value = await this.getInputTemplate();
}
this.closeDiffEditors(indexResources, workingGroupResources);
// Accept working set changes across all chat sessions
const resources = indexResources.length !== 0
? indexResources.map(r => Uri.file(r))
: workingGroupResources.map(r => Uri.file(r));
commands.executeCommand('_chat.editSessions.accept', resources);
}
private commitOperationGetOptimisticResourceGroups(opts: CommitOptions): GitResourceGroups {