Skip to content

Commit

Permalink
SCM - quick diff should better handle untracked files (#236315)
Browse files Browse the repository at this point in the history
  • Loading branch information
lszomoru authored Dec 17, 2024
1 parent 95386de commit ca3ff9f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 7 additions & 1 deletion extensions/git/src/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 0 additions & 4 deletions src/vs/workbench/contrib/scm/browser/quickDiffModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit ca3ff9f

Please sign in to comment.