Exemplo n.º 1
0
 private AsyncLazy <ImmutableList <GitRef> > BuildRemoteBranches()
 {
     return(new AsyncLazy <ImmutableList <GitRef> >(async() =>
     {
         await cli.EnsureInitialized.ConfigureAwait(false);
         var remoteBranches = cli.GetRemoteBranches();
         await remoteBranches.ActiveState.DefaultIfEmpty().ToTask().ConfigureAwait(false);
         await remoteBranches.ActiveOutput.DefaultIfEmpty().ToTask().ConfigureAwait(false);
         // Because listing remote branches doesn't affect the index, it doesn't need to be an action, but it does need to wait until initialization is ensured.
         return GitCliExtensions.BranchListingToRefs(remoteBranches.Output);
     }));
 }