Пример #1
0
 public IObservable <ImmutableList <PullRequest> > GetUpstreamPullRequests(string branchName)
 {
     return(repositoryState.RemoteBranches()
            .Select(remoteBranches =>
     {
         var branch = branchIteration.GetLatestBranchNameIteration(branchName, remoteBranches.Select(b => b.Name).Where(candidate => branchIteration.IsBranchIteration(branchName, candidate)));
         return gitApi.GetPullRequests(state: PullRequestState.Open, targetBranch: branch, includeReviews: true);
     }).Switch());
 }
Пример #2
0
 public static Task <bool> HasOpenPullRequest(this IGitServiceApi api, string targetBranch = null, string sourceBranch = null)
 {
     return(api.GetPullRequests(state: PullRequestState.Open, targetBranch: targetBranch, sourceBranch: sourceBranch).ContinueWith(t => t.Result.Count > 0));
 }
Пример #3
0
 internal Task <ImmutableList <PullRequest> > LoadPullRequests(string source, string target, bool includeReviews, PullRequestAuthorMode authorMode)
 {
     // TODO - better loaders
     return(gitService.GetPullRequests(state: null, targetBranch: target, sourceBranch: source, includeReviews: includeReviews, authorMode: authorMode));
 }