Git - use diff instead of diff-tree for showing commit data and comparing branches (#273969)

This commit is contained in:
Ladislau Szomoru
2025-10-29 16:28:46 +01:00
committed by GitHub
parent d49049e526
commit 20ded57d68
5 changed files with 23 additions and 49 deletions

View File

@@ -3145,7 +3145,7 @@ export class CommandCenter {
const sourceCommit = sourceRef.ref.commit;
try {
const changes = await repository.diffTrees(sourceCommit, historyItem.id);
const changes = await repository.diffBetween2(sourceCommit, historyItem.id);
if (changes.length === 0) {
window.showInformationMessage(l10n.t('The selected references have no differences.'));
@@ -3203,7 +3203,7 @@ export class CommandCenter {
}
try {
const changes = await repository.diffTrees(ref1.id, ref2.id);
const changes = await repository.diffBetween2(ref1.id, ref2.id);
if (changes.length === 0) {
window.showInformationMessage(l10n.t('There are no changes between "{0}" and "{1}".', ref1.name, ref2.name));
@@ -4897,7 +4897,7 @@ export class CommandCenter {
const commit = await repository.getCommit(item.ref);
const commitParentId = commit.parents.length > 0 ? commit.parents[0] : await repository.getEmptyTree();
const changes = await repository.diffTrees(commitParentId, commit.hash);
const changes = await repository.diffBetween2(commitParentId, commit.hash);
const resources = changes.map(c => toMultiFileDiffEditorUris(c, commitParentId, commit.hash));
const title = `${item.shortRef} - ${subject(commit.message)}`;
@@ -5171,7 +5171,7 @@ export class CommandCenter {
const multiDiffSourceUri = Uri.from({ scheme: 'scm-history-item', path: `${repository.root}/${historyItemParentId}..${historyItemId}` });
const changes = await repository.diffTrees(historyItemParentId, historyItemId);
const changes = await repository.diffBetween2(historyItemParentId, historyItemId);
const resources = changes.map(c => toMultiFileDiffEditorUris(c, historyItemParentId, historyItemId));
const reveal = revealUri ? { modifiedUri: toGitUri(revealUri, historyItemId) } : undefined;