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

Commit 6755867

Browse files
authored
Merge branch 'master' into fixes/1725-build-2017-target-2015
2 parents 4701f8e + 0c5e175 commit 6755867

File tree

39 files changed

+278
-149
lines changed

39 files changed

+278
-149
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '2.5.3.{build}'
1+
version: '2.5.4.{build}'
22
skip_tags: true
33
install:
44
- ps: |

src/CredentialManagement/CredentialManagement.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>CredentialManagement</RootNamespace>
1111
<AssemblyName>GitHub.CredentialManagement</AssemblyName>
12+
<LangVersion>6</LangVersion>
1213
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
1314
<FileAlignment>512</FileAlignment>
1415
<CodeAnalysisRuleSet>..\common\GitHubVS.ruleset</CodeAnalysisRuleSet>

src/GitHub.Api/GitHub.Api.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>GitHub.Api</RootNamespace>
1111
<AssemblyName>GitHub.Api</AssemblyName>
12+
<LangVersion>6</LangVersion>
1213
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
1314
<FileAlignment>512</FileAlignment>
1415
<CodeAnalysisRuleSet>..\common\GitHubVS.ruleset</CodeAnalysisRuleSet>

src/GitHub.App/GitHub.App.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<AppDesignerFolder>Properties</AppDesignerFolder>
1212
<RootNamespace>GitHub.App</RootNamespace>
1313
<AssemblyName>GitHub.App</AssemblyName>
14+
<LangVersion>6</LangVersion>
1415
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
1516
<FileAlignment>512</FileAlignment>
1617
<CodeAnalysisRuleSet>..\common\GitHubVS.ruleset</CodeAnalysisRuleSet>

src/GitHub.App/Services/GitClient.cs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,30 @@ public Task Fetch(IRepository repository, string remoteName)
9696

9797
public Task Fetch(IRepository repo, UriString cloneUrl, params string[] refspecs)
9898
{
99-
var httpsUrl = UriString.ToUriString(cloneUrl.ToRepositoryUrl());
99+
var httpsString = cloneUrl.ToRepositoryUrl().ToString();
100100

101-
var originRemote = repo.Network.Remotes[defaultOriginName];
102-
if (originRemote != null && originRemote.Url == httpsUrl)
101+
foreach (var remote in repo.Network.Remotes)
103102
{
104-
return Fetch(repo, defaultOriginName, refspecs);
103+
var remoteUrl = new UriString(remote.Url);
104+
if (!remoteUrl.IsHypertextTransferProtocol)
105+
{
106+
// Only match http urls
107+
continue;
108+
}
109+
110+
var remoteHttpsString = remoteUrl.ToRepositoryUrl().ToString();
111+
if (remoteHttpsString.Equals(httpsString, StringComparison.OrdinalIgnoreCase))
112+
{
113+
return Fetch(repo, defaultOriginName, refspecs);
114+
}
105115
}
106116

107117
return Task.Factory.StartNew(() =>
108118
{
109119
try
110120
{
111121
var tempRemoteName = cloneUrl.Owner + "-" + Guid.NewGuid();
112-
var remote = repo.Network.Remotes.Add(tempRemoteName, httpsUrl);
122+
var remote = repo.Network.Remotes.Add(tempRemoteName, httpsString);
113123
try
114124
{
115125
#pragma warning disable 0618 // TODO: Replace `Network.Fetch` with `Commands.Fetch`.

src/GitHub.App/Services/PullRequestService.cs

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,25 +150,40 @@ public IObservable<bool> IsWorkingDirectoryClean(ILocalRepositoryModel repositor
150150
using (var repo = gitService.GetRepository(repository.LocalPath))
151151
{
152152
var statusOptions = new StatusOptions { ExcludeSubmodules = true };
153-
var isClean = !IsFilthy(repo.RetrieveStatus(statusOptions));
153+
var status = repo.RetrieveStatus(statusOptions);
154+
var isClean = !IsCheckoutBlockingDirty(status);
154155
return Observable.Return(isClean);
155156
}
156157
}
157158

158-
static bool IsFilthy(RepositoryStatus status)
159+
static bool IsCheckoutBlockingDirty(RepositoryStatus status)
159160
{
160161
if (status.IsDirty)
161162
{
162-
// This is similar to IsDirty, but also allows NewInWorkdir files
163-
return status.Any(entry =>
164-
entry.State != FileStatus.Ignored &&
165-
entry.State != FileStatus.Unaltered &&
166-
entry.State != FileStatus.NewInWorkdir);
163+
return status.Any(entry => IsCheckoutBlockingChange(entry));
167164
}
168165

169166
return false;
170167
}
171168

169+
// This is similar to IsDirty, but also allows NewInWorkdir and DeletedFromWorkdir files
170+
static bool IsCheckoutBlockingChange(StatusEntry entry)
171+
{
172+
switch (entry.State)
173+
{
174+
case FileStatus.Ignored:
175+
return false;
176+
case FileStatus.Unaltered:
177+
return false;
178+
case FileStatus.NewInWorkdir:
179+
return false;
180+
case FileStatus.DeletedFromWorkdir:
181+
return false;
182+
default:
183+
return true;
184+
}
185+
}
186+
172187
public IObservable<Unit> Pull(ILocalRepositoryModel repository)
173188
{
174189
return Observable.Defer(async () =>

src/GitHub.Exports.Reactive/GitHub.Exports.Reactive.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<AppDesignerFolder>Properties</AppDesignerFolder>
1111
<RootNamespace>GitHub</RootNamespace>
1212
<AssemblyName>GitHub.Exports.Reactive</AssemblyName>
13+
<LangVersion>6</LangVersion>
1314
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
1415
<FileAlignment>512</FileAlignment>
1516
<CodeAnalysisRuleSet>..\common\GitHubVS.ruleset</CodeAnalysisRuleSet>

src/GitHub.Exports.Reactive/Services/IPullRequestSession.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,10 @@ Task<IPullRequestReviewCommentModel> PostReviewComment(
109109
/// Posts a PR review comment reply.
110110
/// </summary>
111111
/// <param name="body">The comment body.</param>
112-
/// <param name="inReplyTo">The REST ID of the comment to reply to.</param>
113112
/// <param name="inReplyToNodeId">The GraphQL ID of the comment to reply to.</param>
114113
/// <returns>A comment model.</returns>
115114
Task<IPullRequestReviewCommentModel> PostReviewComment(
116115
string body,
117-
int inReplyTo,
118116
string inReplyToNodeId);
119117

120118
/// <summary>

src/GitHub.Exports/GitHub.Exports.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<AppDesignerFolder>Properties</AppDesignerFolder>
1111
<RootNamespace>GitHub</RootNamespace>
1212
<AssemblyName>GitHub.Exports</AssemblyName>
13+
<LangVersion>6</LangVersion>
1314
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
1415
<FileAlignment>512</FileAlignment>
1516
<CodeAnalysisRuleSet>..\common\GitHubVS.ruleset</CodeAnalysisRuleSet>

src/GitHub.Extensions.Reactive/GitHub.Extensions.Reactive.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>GitHub.Extensions.Reactive</RootNamespace>
1111
<AssemblyName>GitHub.Extensions.Reactive</AssemblyName>
12+
<LangVersion>6</LangVersion>
1213
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
1314
<FileAlignment>512</FileAlignment>
1415
<CodeAnalysisRuleSet>..\common\GitHubVS.ruleset</CodeAnalysisRuleSet>

0 commit comments

Comments
 (0)