Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit d9fde96

Browse files
committed
String comparison fixes
1 parent de373f2 commit d9fde96

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/GitHub.Api/IO/NiceIO.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,8 @@ public int CompareTo(object obj)
464464

465465
public bool HasExtension(params string[] extensions)
466466
{
467-
var extensionWithDotLower = ExtensionWithDot.ToLower(CultureInfo.InvariantCulture);
468-
return extensions.Any(e => WithDot(e).ToLower(CultureInfo.InvariantCulture) == extensionWithDotLower);
467+
var extensionWithDotLower = ExtensionWithDot.ToUpperInvariant();
468+
return extensions.Any(e => WithDot(e).ToUpperInvariant() == extensionWithDotLower);
469469
}
470470

471471
private static string WithDot(string extension)

src/GitHub.Api/Installer/GitInstaller.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public bool IsGitLfsExtracted()
9999
var calculateMd5 = environment.FileSystem.CalculateMD5(GitLfsExecutablePath);
100100
logger.Trace("GitLFS MD5: {0}", calculateMd5);
101101
var md5 = environment.IsWindows ? WindowsGitLfsExecutableMD5 : MacGitLfsExecutableMD5;
102-
if (md5.Equals(calculateMd5, StringComparison.InvariantCultureIgnoreCase))
102+
if (md5.Equals(calculateMd5, StringComparison.OrdinalIgnoreCase))
103103
{
104104
logger.Trace("{0} has incorrect MD5", GitExecutablePath);
105105
return false;

src/GitHub.Api/OutputProcessors/LogEntryOutputProcessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public override void LineReceived(string line)
135135

136136
case ProcessingPhase.Summary:
137137
{
138-
var idx = line.IndexOf("---GHUBODYEND---", StringComparison.InvariantCulture);
138+
var idx = line.IndexOf("---GHUBODYEND---", StringComparison.Ordinal);
139139
var oneliner = idx >= 0;
140140
if (oneliner)
141141
{

src/GitHub.Api/OutputProcessors/RemoteListOutputProcessor.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ public override void LineReceived(string line)
5656

5757
private void ReturnRemote()
5858
{
59-
var modes = currentModes.Select(s => s.ToLowerInvariant()).ToArray();
59+
var modes = currentModes.Select(s => s.ToUpperInvariant()).ToArray();
6060

61-
var isFetch = modes.Contains("fetch");
62-
var isPush = modes.Contains("push");
61+
var isFetch = modes.Contains("FETCH");
62+
var isPush = modes.Contains("PUSH");
6363

6464
GitRemoteFunction remoteFunction;
6565
if (isFetch && isPush)

0 commit comments

Comments
 (0)