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

Commit 88a753a

Browse files
committed
Force the enumeration to complete before disposing
We don't want to dispose of Repository while still enumerating its branches.
1 parent 4db51b2 commit 88a753a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/GitHub.App/Services/PullRequestService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,11 @@ public IObservable<IBranch> GetLocalBranches(ILocalRepositoryModel repository, I
251251
{
252252
return Observable.Defer(() =>
253253
{
254-
// BranchModel doesn't keep a reference to repo
254+
// BranchModel doesn't keep a reference to rep
255255
using (var repo = gitService.GetRepository(repository.LocalPath))
256256
{
257257
var result = GetLocalBranchesInternal(repository, repo, pullRequest).Select(x => new BranchModel(x, repository));
258-
return result.ToObservable();
258+
return result.ToList().ToObservable();
259259
}
260260
});
261261
}

0 commit comments

Comments
 (0)