-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged PR 585338: Cut new release including security fix
**Changes:** 1. Fix NTLM proxy authentication 2. Fix reading empty Git configuration entry values 3. Allow users to select the type of interactive authentication flow for the Microsoft auth stack
- Loading branch information
Showing
17 changed files
with
500 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
src/shared/Microsoft.Git.CredentialManager.Tests/EnvironmentTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
using System.Collections.Generic; | ||
using Microsoft.Git.CredentialManager.Interop.Windows; | ||
using Microsoft.Git.CredentialManager.Tests.Objects; | ||
using Xunit; | ||
|
||
namespace Microsoft.Git.CredentialManager.Tests | ||
{ | ||
public class EnvironmentTests | ||
{ | ||
[PlatformFact(Platforms.Windows)] | ||
public void WindowsEnvironment_TryLocateExecutable_NotExists_ReturnFalse() | ||
{ | ||
string pathVar = @"C:\Users\john.doe\bin;C:\Windows\system32;C:\Windows"; | ||
string execName = "foo.exe"; | ||
var fs = new TestFileSystem(); | ||
var envars = new Dictionary<string, string> {["PATH"] = pathVar}; | ||
var env = new WindowsEnvironment(fs, envars); | ||
|
||
bool actualResult = env.TryLocateExecutable(execName, out string actualPath); | ||
|
||
Assert.False(actualResult); | ||
Assert.Null(actualPath); | ||
} | ||
|
||
[PlatformFact(Platforms.Windows)] | ||
public void WindowsEnvironment_TryLocateExecutable_Windows_Exists_ReturnTrueAndPath() | ||
{ | ||
string pathVar = @"C:\Users\john.doe\bin;C:\Windows\system32;C:\Windows"; | ||
string execName = "foo.exe"; | ||
string expectedPath = @"C:\Windows\system32\foo.exe"; | ||
var fs = new TestFileSystem | ||
{ | ||
Files = new Dictionary<string, byte[]> | ||
{ | ||
[@"C:\Windows\system32\foo.exe"] = new byte[0], | ||
} | ||
}; | ||
var envars = new Dictionary<string, string> {["PATH"] = pathVar}; | ||
var env = new WindowsEnvironment(fs, envars); | ||
|
||
bool actualResult = env.TryLocateExecutable(execName, out string actualPath); | ||
|
||
Assert.True(actualResult); | ||
Assert.Equal(expectedPath, actualPath); | ||
} | ||
|
||
[PlatformFact(Platforms.Windows)] | ||
public void WindowsEnvironment_TryLocateExecutable_Windows_ExistsMultiple_ReturnTrueAndFirstPath() | ||
{ | ||
string pathVar = @"C:\Users\john.doe\bin;C:\Windows\system32;C:\Windows"; | ||
string execName = "foo.exe"; | ||
string expectedPath = @"C:\Users\john.doe\bin\foo.exe"; | ||
var fs = new TestFileSystem | ||
{ | ||
Files = new Dictionary<string, byte[]> | ||
{ | ||
[@"C:\Users\john.doe\bin\foo.exe"] = new byte[0], | ||
[@"C:\Windows\system32\foo.exe"] = new byte[0], | ||
[@"C:\Windows\foo.exe"] = new byte[0], | ||
} | ||
}; | ||
var envars = new Dictionary<string, string> {["PATH"] = pathVar}; | ||
var env = new WindowsEnvironment(fs, envars); | ||
|
||
bool actualResult = env.TryLocateExecutable(execName, out string actualPath); | ||
|
||
Assert.True(actualResult); | ||
Assert.Equal(expectedPath, actualPath); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.