From 825608f12a09cb0f5d87cfa0162e7c953cfffb05 Mon Sep 17 00:00:00 2001 From: Eddy Moulton Date: Wed, 11 Nov 2026 11:07:08 +1100 Subject: [PATCH 1/2] Update to dotnet10 --- .github/workflows/ci.yml | 27 ++++++++++---------- LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj | 2 +- TrimmingTestApp/TrimmingTestApp.csproj | 2 +- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e770e8cc..8b55d053a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: - name: Install .NET SDK uses: actions/setup-dotnet@v5 with: - dotnet-version: 9.0.x + dotnet-version: 10.0.x - name: Compute version override for branch builds if: ${{ !startsWith(github.ref, 'refs/tags/') }} id: version @@ -53,21 +53,22 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - arch: [ x64 ] - os: [ windows-2022, windows-2025, macos-14, macos-15 ] - tfm: [ net472, net8.0, net9.0 ] + os: [ windows-2022, windows-2025, macos-15, macos-26 ] + tfm: [ net472, net8.0, net10.0 ] exclude: - - os: macos-14 - tfm: net472 - os: macos-15 tfm: net472 + - os: macos-26 + tfm: net472 include: - - arch: arm64 - os: macos-14 - tfm: net8.0 - - arch: arm64 - os: macos-14 - tfm: net9.0 + - os: windows-2022 + arch: x64 + - os: windows-2025 + arch: x64 + - os: macos-15 + arch: arm64 + - os: macos-26 + arch: arm64 fail-fast: false steps: - name: Checkout @@ -78,7 +79,7 @@ jobs: uses: actions/setup-dotnet@v5 with: dotnet-version: | - 9.0.x + 10.0.x 8.0.x - name: Run ${{ matrix.tfm }} tests run: dotnet test LibGit2Sharp.sln --configuration Release --framework ${{ matrix.tfm }} --logger "GitHubActions" /p:ExtraDefine=LEAKS_IDENTIFYING diff --git a/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj b/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj index fb81a76a3..3552a2bf8 100644 --- a/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj +++ b/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj @@ -1,7 +1,7 @@  - net472;net8.0;net9.0 + net472;net8.0;net10.0 diff --git a/TrimmingTestApp/TrimmingTestApp.csproj b/TrimmingTestApp/TrimmingTestApp.csproj index 3c6d341f6..56594111a 100644 --- a/TrimmingTestApp/TrimmingTestApp.csproj +++ b/TrimmingTestApp/TrimmingTestApp.csproj @@ -1,7 +1,7 @@  - net9.0 + net10.0 Exe enable enable From 9aa7433bcac0570033d86fba89516c2cc2f3ed95 Mon Sep 17 00:00:00 2001 From: Eddy Moulton Date: Wed, 11 Nov 2026 11:28:31 +1100 Subject: [PATCH 2/2] Fix warning --- LibGit2Sharp/CertificateX509.cs | 4 ++++ LibGit2Sharp/LibGit2Sharp.csproj | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/LibGit2Sharp/CertificateX509.cs b/LibGit2Sharp/CertificateX509.cs index 7b5b0fac6..6f82845d9 100644 --- a/LibGit2Sharp/CertificateX509.cs +++ b/LibGit2Sharp/CertificateX509.cs @@ -26,7 +26,11 @@ internal unsafe CertificateX509(git_certificate_x509* cert) int len = checked((int)cert->len.ToUInt32()); byte[] data = new byte[len]; Marshal.Copy(new IntPtr(cert->data), data, 0, len); +#if NET9_0_OR_GREATER + Certificate = X509CertificateLoader.LoadCertificate(data); +#else Certificate = new X509Certificate(data); +#endif } internal CertificateX509(X509Certificate cert) diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index 781fede8c..10a302bec 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -1,7 +1,7 @@  - net472;net8.0 + net472;net8.0;net10.0 12.0 true LibGit2Sharp brings all the might and speed of libgit2, a native Git implementation, to the managed world of .NET @@ -25,7 +25,7 @@ libgit2-$(libgit2_hash.Substring(0,7)) - + true