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

Commit 3b84532

Browse files
committed
Add assert for updated origin URL
1 parent aba6a22 commit 3b84532

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/GitHub.App/Services/RepositoryForkService.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Linq;
23
using System.ComponentModel.Composition;
34
using System.Reactive.Linq;
45
using System.Threading.Tasks;
@@ -101,14 +102,18 @@ public IObservable<object> SwitchRemotes(IRepositoryModel destinationRepository,
101102

102103
await SwitchRemotes(activeRepo, updateOrigin ? destinationRepository.CloneUrl.ToUri() : null,
103104
currentOrigin, trackMasterUpstream);
105+
}
104106

105-
if (updateOrigin)
106-
{
107-
vsGitExt.RefreshActiveRepositories();
108-
}
107+
if (updateOrigin)
108+
{
109+
vsGitExt.RefreshActiveRepositories();
109110

110-
return new object();
111+
var updatedRepository = vsGitExt.ActiveRepositories.FirstOrDefault();
112+
log.Assert(updatedRepository.CloneUrl == destinationRepository.CloneUrl,
113+
"CloneUrl is {UpdatedRepository} not {DestinationRepository}", updatedRepository.CloneUrl, destinationRepository.CloneUrl);
111114
}
115+
116+
return new object();
112117
});
113118
}
114119

0 commit comments

Comments
 (0)