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

Commit e1b4f4b

Browse files
committed
Fix md5 comparisons
1 parent a9a092e commit e1b4f4b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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 (calculateMd5 != md5)
102+
if (String.Compare(calculateMd5, md5, true) != 0)
103103
{
104104
logger.Trace("{0} has incorrect MD5", GitExecutablePath);
105105
return false;

src/tests/IntegrationTests/Git/GitSetupTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public async Task InstallGit()
4242
gitLfsDestinationPath.FileExists().Should().BeTrue();
4343

4444
var calculateMd5 = NPath.FileSystem.CalculateMD5(gitLfsDestinationPath);
45-
GitInstaller.WindowsGitLfsExecutableMD5.Should().Be(calculateMd5);
45+
Assert.IsTrue(string.Compare(calculateMd5, GitInstaller.WindowsGitLfsExecutableMD5, true) == 0);
4646

4747
setupDone = await gitSetup.SetupIfNeeded(new Progress<float>(x => percent = x));
4848
setupDone.Should().BeFalse();

0 commit comments

Comments
 (0)