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

Commit 584b7c4

Browse files
Merge remote-tracking branch 'remotes/origin/fixes/1646-refresh-origin-url' into feature/github-fork
2 parents c3fc7d4 + dd96043 commit 584b7c4

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/GitHub.App/Services/TeamExplorerContext.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.ComponentModel.Composition;
55
using GitHub.Models;
66
using GitHub.Logging;
7+
using GitHub.Primitives;
78
using Serilog;
89
using EnvDTE;
910

@@ -31,6 +32,7 @@ public class TeamExplorerContext : ITeamExplorerContext
3132

3233
string solutionPath;
3334
string repositoryPath;
35+
UriString cloneUrl;
3436
string branchName;
3537
string headSha;
3638
string trackedSha;
@@ -70,6 +72,7 @@ void Refresh()
7072
else
7173
{
7274
var newRepositoryPath = repo?.LocalPath;
75+
var newCloneUrl = repo?.CloneUrl;
7376
var newBranchName = repo?.CurrentBranch?.Name;
7477
var newHeadSha = repo?.CurrentBranch?.Sha;
7578
var newTrackedSha = repo?.CurrentBranch?.TrackedSha;
@@ -79,6 +82,11 @@ void Refresh()
7982
log.Debug("ActiveRepository changed to {CloneUrl} @ {Path}", repo?.CloneUrl, newRepositoryPath);
8083
ActiveRepository = repo;
8184
}
85+
else if (newCloneUrl != cloneUrl)
86+
{
87+
log.Debug("ActiveRepository changed to {CloneUrl} @ {Path}", repo?.CloneUrl, newRepositoryPath);
88+
ActiveRepository = repo;
89+
}
8290
else if (newBranchName != branchName)
8391
{
8492
log.Debug("Fire StatusChanged event when BranchName changes for ActiveRepository");
@@ -96,6 +104,7 @@ void Refresh()
96104
}
97105

98106
repositoryPath = newRepositoryPath;
107+
cloneUrl = newCloneUrl;
99108
branchName = newBranchName;
100109
headSha = newHeadSha;
101110
solutionPath = newSolutionPath;

src/GitHub.Exports/Services/IVSGitExt.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ public interface IVSGitExt
88
{
99
IReadOnlyList<ILocalRepositoryModel> ActiveRepositories { get; }
1010
event Action ActiveRepositoriesChanged;
11+
void RefreshActiveRepositories();
1112
}
1213
}

src/GitHub.TeamFoundation.14/Services/VSGitExt.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void Initialize()
7474
}, TaskScheduler.Default);
7575
}
7676

77-
void RefreshActiveRepositories()
77+
public void RefreshActiveRepositories()
7878
{
7979
try
8080
{

0 commit comments

Comments
 (0)