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

Commit ccebc24

Browse files
committed
Rename HasNoRemoteOrigin to HasRemotesButNoOrigin
This is more explicit about what it actually checks.
1 parent d6f5107 commit ccebc24

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/GitHub.App/ViewModels/GitHubPane/GitHubPaneViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ async Task UpdateContent(LocalRepositoryModel repository)
413413
}
414414
else if (string.IsNullOrWhiteSpace(repository.CloneUrl))
415415
{
416-
if (repository.HasNoRemoteOrigin)
416+
if (repository.HasRemotesButNoOrigin)
417417
{
418418
log.Debug("No origin remote");
419419
Content = noRemoteOrigin;

src/GitHub.Exports/Models/LocalRepositoryModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public string LocalPath
2727
/// <summary>
2828
/// True if repository has remotes but none are named "origin".
2929
/// </summary>
30-
public bool HasNoRemoteOrigin
30+
public bool HasRemotesButNoOrigin
3131
{
3232
get; set;
3333
}

src/GitHub.Exports/Services/GitService.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ public LocalRepositoryModel CreateLocalRepositoryModel(string localPath)
4242
using (var repository = GetRepository(localPath))
4343
{
4444
UriString cloneUrl = null;
45-
bool noRemoteOrigin = false;
45+
bool noOrigin = false;
4646
if (repository != null)
4747
{
4848
cloneUrl = GetUri(repository);
49-
noRemoteOrigin = HasNoRemoteOrigin(repository);
49+
noOrigin = HasRemotesButNoOrigin(repository);
5050
}
5151

5252
var name = cloneUrl?.RepositoryName ?? dir.Name;
@@ -55,7 +55,7 @@ public LocalRepositoryModel CreateLocalRepositoryModel(string localPath)
5555
{
5656
LocalPath = localPath,
5757
CloneUrl = cloneUrl,
58-
HasNoRemoteOrigin = noRemoteOrigin,
58+
HasRemotesButNoOrigin = noOrigin,
5959
Name = name,
6060
Icon = Octicon.repo
6161
};
@@ -137,7 +137,7 @@ public IRepository GetRepository(string path)
137137
/// </summary>
138138
/// <param name="repo">The target repository.</param>
139139
/// <returns>True if repository has remotes but none are called "origin".</returns>
140-
public bool HasNoRemoteOrigin(IRepository repo)
140+
public bool HasRemotesButNoOrigin(IRepository repo)
141141
{
142142
var remotes = repo.Network.Remotes;
143143
return remotes["origin"] == null && remotes.Any();

src/GitHub.InlineReviews/Services/PullRequestStatusBarManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void StartShowingStatus()
8686

8787
async Task RefreshCurrentSession(LocalRepositoryModel repository, IPullRequestSession session)
8888
{
89-
if (repository.HasNoRemoteOrigin)
89+
if (repository.HasRemotesButNoOrigin)
9090
{
9191
NoRemoteOriginCallout();
9292
}

test/GitHub.Exports.UnitTests/GitServiceIntegrationTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void No_Directory()
3838
[TestCase("origin", "https://github.com/github/VisualStudio", false)]
3939
[TestCase("not_origin", "https://github.com/github/VisualStudio", true)]
4040
[TestCase(null, null, false, Description = "Has no remotes")]
41-
public void Check_HasNoRemoteOrigin(string remoteName, string remoteUrl, bool hasNoRemoteOrigin)
41+
public void Check_HasRemotesButNoOrigin(string remoteName, string remoteUrl, bool noOrigin)
4242
{
4343
using (var temp = new TempRepository())
4444
{
@@ -51,7 +51,7 @@ public void Check_HasNoRemoteOrigin(string remoteName, string remoteUrl, bool ha
5151

5252
var model = target.CreateLocalRepositoryModel(path);
5353

54-
Assert.That(model.HasNoRemoteOrigin, Is.EqualTo(hasNoRemoteOrigin));
54+
Assert.That(model.HasRemotesButNoOrigin, Is.EqualTo(noOrigin));
5555
}
5656
}
5757

0 commit comments

Comments
 (0)