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

Commit eec41c3

Browse files
committed
Fix GetOldFileName
1 parent f8c52cd commit eec41c3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/GitHub.App/ViewModels/GitHubPane/PullRequestFilesViewModel.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using System.Windows.Input;
1313
using GitHub.Extensions;
1414
using GitHub.Models;
15+
using GitHub.Primitives;
1516
using GitHub.Services;
1617
using LibGit2Sharp;
1718
using ReactiveUI;
@@ -224,8 +225,8 @@ static string GetOldFileName(PullRequestFileModel file, TreeChanges changes)
224225
{
225226
if (file.Status == PullRequestFileStatus.Renamed)
226227
{
227-
var fileName = file.FileName.Replace("/", "\\");
228-
return changes?.Renamed.FirstOrDefault(x => x.Path == fileName)?.OldPath;
228+
var gitPath = Paths.ToGitPath(file.FileName);
229+
return changes?.Renamed.FirstOrDefault(x => x.Path == gitPath)?.OldPath;
229230
}
230231

231232
return null;

0 commit comments

Comments
 (0)