@@ -93,7 +93,7 @@ public PullRequestDetailViewModel(
9393 Checkout = ReactiveCommand . CreateAsyncObservable (
9494 this . WhenAnyValue ( x => x . CheckoutState )
9595 . Cast < CheckoutCommandState > ( )
96- . Select ( x => x != null && x . IsEnabled ) ,
96+ . Select ( x => x != null && x . IsEnabled ) ,
9797 DoCheckout ) ;
9898 Checkout . IsExecuting . Subscribe ( x => isInCheckout = x ) ;
9999 SubscribeOperationError ( Checkout ) ;
@@ -145,13 +145,13 @@ private set
145145 public ILocalRepositoryModel LocalRepository { get ; }
146146
147147 /// <summary>
148- /// Gets the remote repository that contains the pull request.
148+ /// Gets the owner of the remote repository that contains the pull request.
149149 /// </summary>
150150 /// <remarks>
151151 /// The remote repository may be different from the local repository if the local
152152 /// repository is a fork and the user is viewing pull requests from the parent repository.
153153 /// </remarks>
154- public IRemoteRepositoryModel RemoteRepository { get ; private set ; }
154+ public string RemoteRepositoryOwner { get ; private set ; }
155155
156156 /// <summary>
157157 /// Gets the session for the pull request.
@@ -323,13 +323,13 @@ public IReadOnlyList<IPullRequestChangeNode> ChangedFilesTree
323323 public override void Initialize ( ViewWithData data )
324324 {
325325 int number ;
326- var repo = RemoteRepository ;
326+ var repoOwner = RemoteRepositoryOwner ;
327327
328328 if ( data != null )
329329 {
330330 var arg = ( PullRequestDetailArgument ) data . Data ;
331331 number = arg . Number ;
332- repo = arg . Repository ;
332+ repoOwner = arg . RepositoryOwner ;
333333 }
334334 else
335335 {
@@ -346,7 +346,7 @@ public override void Initialize(ViewWithData data)
346346 }
347347
348348 ErrorMessage = OperationError = null ;
349- modelService . GetPullRequest ( repo , number )
349+ modelService . GetPullRequest ( repoOwner , LocalRepository . Name , number )
350350 . TakeLast ( 1 )
351351 . ObserveOn ( RxApp . MainThreadScheduler )
352352 . Catch < IPullRequestModel , Exception > ( ex =>
@@ -355,23 +355,23 @@ public override void Initialize(ViewWithData data)
355355 IsLoading = IsBusy = false ;
356356 return Observable . Empty < IPullRequestModel > ( ) ;
357357 } )
358- . Subscribe ( x => Load ( repo , x ) . Forget ( ) ) ;
358+ . Subscribe ( x => Load ( repoOwner , x ) . Forget ( ) ) ;
359359 }
360360
361361 /// <summary>
362362 /// Loads the view model from octokit models.
363363 /// </summary>
364- /// <param name="remoteRepository ">The remote repository.</param>
364+ /// <param name="remoteRepositoryOwner ">The owner of the remote repository.</param>
365365 /// <param name="pullRequest">The pull request model.</param>
366- public async Task Load ( IRemoteRepositoryModel remoteRepository , IPullRequestModel pullRequest )
366+ public async Task Load ( string remoteRepositoryOwner , IPullRequestModel pullRequest )
367367 {
368- Guard . ArgumentNotNull ( remoteRepository , nameof ( remoteRepository ) ) ;
368+ Guard . ArgumentNotNull ( remoteRepositoryOwner , nameof ( remoteRepositoryOwner ) ) ;
369369
370370 try
371371 {
372372 var firstLoad = ( Model == null ) ;
373373 Model = pullRequest ;
374- RemoteRepository = remoteRepository ;
374+ RemoteRepositoryOwner = remoteRepositoryOwner ;
375375 Session = await sessionManager . GetSession ( pullRequest ) ;
376376 Title = Resources . PullRequestNavigationItemText + " #" + pullRequest . Number ;
377377
0 commit comments