Git - revert some changes that are not needed (#248215)

This commit is contained in:
Ladislau Szomoru
2025-05-06 19:30:36 +00:00
committed by GitHub
parent a3e8152d0a
commit d667ffe026
2 changed files with 9 additions and 8 deletions

View File

@@ -2010,12 +2010,12 @@ export class CommandCenter {
this.logger.trace(`[CommandCenter][unstageSelectedRanges] selectedDiffs: ${JSON.stringify(selectedDiffs)}`);
if (modifiedUri.scheme === 'file') {
// Editor
this.logger.trace(`[CommandCenter][unstageSelectedRanges] changes: ${JSON.stringify(selectedDiffs)}`);
await this._unstageChanges(textEditor, selectedDiffs);
return;
}
// if (modifiedUri.scheme === 'file') {
// // Editor
// this.logger.trace(`[CommandCenter][unstageSelectedRanges] changes: ${JSON.stringify(selectedDiffs)}`);
// await this._unstageChanges(textEditor, selectedDiffs);
// return;
// }
const selectedDiffsInverted = selectedDiffs.map(invertLineChange);
this.logger.trace(`[CommandCenter][unstageSelectedRanges] selectedDiffsInverted: ${JSON.stringify(selectedDiffsInverted)}`);

View File

@@ -208,9 +208,10 @@ export function compareLineChanges(a: LineChange, b: LineChange): number {
}
export function getIndexDiffInformation(textEditor: TextEditor): TextEditorDiffInformation | undefined {
// Diff Editor (Index) | Text Editor
// Diff Editor (Index)
return textEditor.diffInformation?.find(diff =>
diff.original && isGitUri(diff.original) && fromGitUri(diff.original).ref === 'HEAD');
diff.original && isGitUri(diff.original) && fromGitUri(diff.original).ref === 'HEAD' &&
diff.modified && isGitUri(diff.modified) && fromGitUri(diff.modified).ref === '');
}
export function getWorkingTreeDiffInformation(textEditor: TextEditor): TextEditorDiffInformation | undefined {