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()); }
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)); }
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)); }