SCM - quick diff should better handle untracked files (#236315)

This commit is contained in:
Ladislau Szomoru
2024-12-17 09:26:30 +01:00
committed by GitHub
parent 95386dec78
commit ca3ff9f564
2 changed files with 7 additions and 5 deletions

View File

@@ -1035,7 +1035,13 @@ export class Repository implements Disposable {
}
// Ignore path that is inside a merge group
if (this.mergeGroup.resourceStates.some(r => r.resourceUri.path === uri.path)) {
if (this.mergeGroup.resourceStates.some(r => pathEquals(r.resourceUri.fsPath, uri.fsPath))) {
return undefined;
}
// Ignore path that is untracked
if (this.untrackedGroup.resourceStates.some(r => pathEquals(r.resourceUri.path, uri.path)) ||
this.workingTreeGroup.resourceStates.some(r => pathEquals(r.resourceUri.path, uri.path) && r.type === Status.UNTRACKED)) {
return undefined;
}

View File

@@ -214,10 +214,6 @@ export class QuickDiffModel extends Disposable {
return; // disposed
}
if (editorModels.every(editorModel => editorModel.textEditorModel.getValueLength() === 0)) {
result.changes = [];
}
this.setChanges(result.changes, result.mapChanges);
})
.catch(err => onUnexpectedError(err));