Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit a652370

Browse files
committed
Clean up publish code
1 parent 31d15cb commit a652370

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/GitHub.App/Services/RepositoryPublishService.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,16 @@ public string LocalRepositoryName
3939
IApiClient apiClient)
4040
{
4141
return Observable.Defer(() => apiClient.CreateRepository(newRepository, account.Login, account.IsUser)
42-
.Select(remoteRepo => new { RemoteRepo = remoteRepo, LocalRepo = activeRepository }))
43-
.SelectMany(repo => gitClient.SetRemote(repo.LocalRepo, "origin", new Uri(repo.RemoteRepo.CloneUrl)).ToObservable().Select(_ => repo))
44-
.SelectMany(repo => gitClient.Push(repo.LocalRepo, "master", "origin").ToObservable().Select(_ => repo))
45-
.SelectMany(repo => gitClient.Fetch(repo.LocalRepo, "origin").ToObservable().Select(_ => repo))
46-
.SelectMany(repo => gitClient.SetTrackingBranch(repo.LocalRepo, "master", "origin").ToObservable().Select(_ => repo.RemoteRepo));
42+
.Select(remoteRepo => new { RemoteRepo = remoteRepo, LocalRepo = activeRepository }))
43+
.Select(async repo =>
44+
{
45+
await gitClient.SetRemote(repo.LocalRepo, "origin", new Uri(repo.RemoteRepo.CloneUrl));
46+
await gitClient.Push(repo.LocalRepo, "master", "origin");
47+
await gitClient.Fetch(repo.LocalRepo, "origin");
48+
await gitClient.SetTrackingBranch(repo.LocalRepo, "master", "origin");
49+
return repo.RemoteRepo;
50+
})
51+
.Select(t => t.Result);
4752
}
4853
}
4954
}

0 commit comments

Comments
 (0)