Skip to content

Commit

Permalink
add env variable to select schannel build
Browse files Browse the repository at this point in the history
UIPATH_STUDIO_GIT_USE_SCHANNEL = 1 will activate the schannel version of libgit2
  • Loading branch information
andrei-balint committed Nov 22, 2023
1 parent 12d44cb commit 1fb3d3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions LibGit2Sharp/Core/NativeMethods.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
Expand Down Expand Up @@ -91,6 +92,12 @@ private static IntPtr ResolveDll(string libraryName, Assembly assembly, DllImpor

if (libraryName == libgit2)
{
if (Environment.GetEnvironmentVariable("UIPATH_STUDIO_GIT_USE_SCHANNEL") == "1")
{
Trace.TraceInformation("Using git with schannel");
libraryName = libraryName + "_schannel";
}

// Use GlobalSettings.NativeLibraryPath when set.
string nativeLibraryPath = GetGlobalSettingsNativeLibraryPath();

Expand Down
2 changes: 1 addition & 1 deletion LibGit2Sharp/LibGit2Sharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="LibGit2Sharp.NativeBinaries.UiPath" Version="1.7.1" PrivateAssets="none"/>
<PackageReference Include="LibGit2Sharp.NativeBinaries.UiPath" Version="1.7.1-v3" PrivateAssets="none"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" />
<PackageReference Include="MinVer" Version="4.3.0" PrivateAssets="all" />
</ItemGroup>
Expand Down

0 comments on commit 1fb3d3f

Please sign in to comment.