Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit aee42c5

Browse files
committed
Fix LHS diff path display.
Fixes #1383
1 parent d2f5350 commit aee42c5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/GitHub.VisualStudio/Views/GitHubPane/PullRequestDetailView.xaml.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ async Task DoDiffFile(IPullRequestFileNode file, bool workingDirectory)
123123
{
124124
try
125125
{
126-
var relativePath = System.IO.Path.Combine(file.DirectoryPath, file.FileName);
126+
var rightPath = System.IO.Path.Combine(file.DirectoryPath, file.FileName);
127+
var leftPath = file.OldPath ?? rightPath;
127128
var rightFile = workingDirectory ? ViewModel.GetLocalFilePath(file) : await ViewModel.ExtractFile(file, true);
128129
var leftFile = await ViewModel.ExtractFile(file, false);
129-
var fullPath = System.IO.Path.Combine(ViewModel.LocalRepository.LocalPath, relativePath);
130-
var leftLabel = $"{relativePath};{ViewModel.TargetBranchDisplayName}";
131-
var rightLabel = workingDirectory ? relativePath : $"{relativePath};PR {ViewModel.Model.Number}";
130+
var leftLabel = $"{leftPath};{ViewModel.TargetBranchDisplayName}";
131+
var rightLabel = workingDirectory ? rightPath : $"{rightPath};PR {ViewModel.Model.Number}";
132132
var caption = $"Diff - {file.FileName}";
133133
var options = __VSDIFFSERVICEOPTIONS.VSDIFFOPT_DetectBinaryFiles |
134134
__VSDIFFSERVICEOPTIONS.VSDIFFOPT_LeftFileIsTemporary;
@@ -161,11 +161,11 @@ async Task DoDiffFile(IPullRequestFileNode file, bool workingDirectory)
161161
var diffViewer = ((IVsDifferenceCodeWindow)docView).DifferenceViewer;
162162

163163
var session = ViewModel.Session;
164-
AddBufferTag(diffViewer.LeftView.TextBuffer, session, relativePath, DiffSide.Left);
164+
AddBufferTag(diffViewer.LeftView.TextBuffer, session, leftPath, DiffSide.Left);
165165

166166
if (!workingDirectory)
167167
{
168-
AddBufferTag(diffViewer.RightView.TextBuffer, session, relativePath, DiffSide.Right);
168+
AddBufferTag(diffViewer.RightView.TextBuffer, session, rightPath, DiffSide.Right);
169169
}
170170

171171
if (workingDirectory)

0 commit comments

Comments
 (0)