8000 Be consistent about how we use relative paths and Git paths by jcansdale · Pull Request #2386 · github/VisualStudio · GitHub
[go: up one dir, main page]

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

Be consistent about how we use relative paths and Git paths #2386

Merged
merged 11 commits into from
Aug 9, 2019
Prev Previous commit
Next Next commit
Fix GetOldFileName
  • Loading branch information
jcansdale committed Jun 13, 2019
commit eec41c3a3a7df47a96af8f0f2f9cc236cb48c466
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using System.Windows.Input;
using GitHub.Extensions;
using GitHub.Models;
using GitHub.Primitives;
using GitHub.Services;
using LibGit2Sharp;
using ReactiveUI;
Expand Down Expand Up @@ -224,8 +225,8 @@ static string GetOldFileName(PullRequestFileModel file, TreeChanges changes)
{
if (file.Status == PullRequestFileStatus.Renamed)
{
var fileName = file.FileName.Replace("/", "\\");
return changes?.Renamed.FirstOrDefault(x => x.Path == fileName)?.OldPath;
var gitPath = Paths.ToGitPath(file.FileName);
return changes?.Renamed.FirstOrDefault(x => x.Path == gitPath)?.OldPath;
}

return null;
Expand Down
0