33using GitHub . App ;
44using GitHub . Extensions ;
55using GitHub . Models ;
6+ using GitHub . Primitives ;
67using ReactiveUI ;
78
89namespace GitHub . ViewModels . GitHubPane
@@ -21,7 +22,7 @@ public class PullRequestFileNode : ReactiveObject, IPullRequestFileNode
2122 /// Initializes a new instance of the <see cref="PullRequestFileNode"/> class.
2223 /// </summary>
2324 /// <param name="repositoryPath">The absolute path to the repository.</param>
24- /// <param name="relativePath ">The path to the file, relative to the repository.</param>
25+ /// <param name="relativeOrGitPath ">The path to the file, relative to the repository.</param>
2526 /// <param name="sha">The SHA of the file.</param>
2627 /// <param name="status">The way the file was changed.</param>
2728 /// <param name="statusDisplay">The string to display in the [message] box next to the filename.</param>
@@ -31,17 +32,17 @@ public class PullRequestFileNode : ReactiveObject, IPullRequestFileNode
3132 /// </param>
3233 public PullRequestFileNode (
3334 string repositoryPath ,
34- string relativePath ,
35+ string relativeOrGitPath ,
3536 string sha ,
3637 PullRequestFileStatus status ,
3738 string oldPath )
3839 {
3940 Guard . ArgumentNotEmptyString ( repositoryPath , nameof ( repositoryPath ) ) ;
40- Guard . ArgumentNotEmptyString ( relativePath , nameof ( relativePath ) ) ;
41+ Guard . ArgumentNotEmptyString ( relativeOrGitPath , nameof ( relativeOrGitPath ) ) ;
4142 Guard . ArgumentNotEmptyString ( sha , nameof ( sha ) ) ;
4243
43- FileName = Path . GetFileName ( relativePath ) ;
44- RelativePath = relativePath . Replace ( "/" , " \\ " ) ;
44+ FileName = Path . GetFileName ( relativeOrGitPath ) ;
45+ RelativePath = Paths . ToRelativePath ( relativeOrGitPath ) ;
4546 Sha = sha ;
4647 Status = status ;
4748 OldPath = oldPath ;
@@ -54,7 +55,7 @@ public PullRequestFileNode(
5455 {
5556 if ( oldPath != null )
5657 {
57- StatusDisplay = Path . GetDirectoryName ( oldPath ) == Path . GetDirectoryName ( relativePath ) ?
58+ StatusDisplay = Path . GetDirectoryName ( oldPath ) == Path . GetDirectoryName ( relativeOrGitPath ) ?
5859 Path . GetFileName ( oldPath ) : oldPath ;
5960 }
6061 else
0 commit comments