diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f44285812..3f419d8c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,8 +36,8 @@ jobs: strategy: matrix: arch: [ amd64 ] - os: [ windows-2019, macos-11 ] - tfm: [ net472, net6.0, net7.0 ] + os: [ macos-11 ] + tfm: [ net6.0, net7.0 ] exclude: - os: macos-11 tfm: net472 @@ -61,19 +61,11 @@ jobs: strategy: matrix: arch: [ amd64 ] - # arch: [ amd64, arm64 ] - distro: [ alpine.3.13, alpine.3.14, alpine.3.15, alpine.3.16, alpine.3.17, centos.7, centos.stream.8, debian.10, debian.11, fedora.36, ubuntu.18.04, ubuntu.20.04, ubuntu.22.04 ] - sdk: [ '6.0', '7.0' ] - exclude: - - distro: alpine.3.13 - sdk: '7.0' - - distro: alpine.3.14 - sdk: '7.0' + distro: [ alpine.3.18, debian.11 ] + sdk: [ '6.0' ] include: - sdk: '6.0' tfm: net6.0 - - sdk: '7.0' - tfm: net7.0 fail-fast: false steps: - name: Checkout diff --git a/.gitignore b/.gitignore index 2f75ccc1d..08c5e1af4 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,4 @@ _ReSharper*/ _NCrunch_LibGit2Sharp/ packages/ worktree.playlist +.idea/ diff --git a/LibGit2Sharp.sln b/LibGit2Sharp.sln index e99eec26f..d9970f59f 100644 --- a/LibGit2Sharp.sln +++ b/LibGit2Sharp.sln @@ -12,7 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Targets\CodeGenerator.targets = Targets\CodeGenerator.targets Directory.Build.props = Directory.Build.props Targets\GenerateNativeDllName.targets = Targets\GenerateNativeDllName.targets - nuget.config = nuget.config + README.md = README.md EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NativeLibraryLoadTestApp.x86", "NativeLibraryLoadTestApp\x86\NativeLibraryLoadTestApp.x86.csproj", "{86453D2C-4953-4DF4-B12A-ADE579608BAA}" diff --git a/LibGit2Sharp/CyclicReferenceException.cs b/LibGit2Sharp/CyclicReferenceException.cs new file mode 100644 index 000000000..006812f3c --- /dev/null +++ b/LibGit2Sharp/CyclicReferenceException.cs @@ -0,0 +1,11 @@ +namespace LibGit2Sharp +{ + public class CyclicReferenceException : LibGit2SharpException + { + public CyclicReferenceException(string reference) : base($"Detected cyclic reference on '{reference}'") + { + } + + protected CyclicReferenceException() {} + } +} diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index f690c9107..464f538ec 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -1,14 +1,15 @@  + Apiiro.LibGit2Sharp net472;net6.0 true LibGit2Sharp brings all the might and speed of libgit2, a native Git implementation, to the managed world of .NET - LibGit2Sharp contributors + Apiiro + Apiiro Copyright © LibGit2Sharp contributors libgit2 git - https://github.com/libgit2/libgit2sharp/ - LibGit2Sharp contributors + https://github.com/apiiro/libgit2sharp true true embedded @@ -50,7 +51,7 @@ $(MinVerMajor).$(MinVerMinor).0.0 - $(MinVerMajor).$(MinVerMinor).$(MinVerPatch) + 0.27.2 $(PackageVersion)-$(MinVerPreRelease) diff --git a/LibGit2Sharp/Reference.cs b/LibGit2Sharp/Reference.cs index 40a85f79f..7de3177d1 100644 --- a/LibGit2Sharp/Reference.cs +++ b/LibGit2Sharp/Reference.cs @@ -54,6 +54,11 @@ internal static unsafe T BuildFromPtr(git_reference* handle, Repository repo) case GitReferenceType.Symbolic: string targetIdentifier = Proxy.git_reference_symbolic_target(handle); + if (name == targetIdentifier) + { + throw new CyclicReferenceException(name); + } + var targetRef = repo.Refs[targetIdentifier]; reference = new SymbolicReference(repo, name, targetIdentifier, targetRef); break; diff --git a/README.md b/README.md index 3aafdceb1..4ee730c80 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,19 @@ # LibGit2Sharp -[![CI](https://github.com/libgit2/libgit2sharp/actions/workflows/ci.yml/badge.svg)](https://github.com/libgit2/libgit2sharp/actions/workflows/ci.yml) +[![CI](https://github.com/libgit2/libgit2sharp/actions/workflows/ci.yml/badge.svg)](https://github.com/libgit2/libgit2sharp/actions/workflows/ci.yml) [![NuGet version (LibGit2Sharp)](https://img.shields.io/nuget/v/LibGit2Sharp.svg)](https://www.nuget.org/packages/LibGit2Sharp/) **LibGit2Sharp brings all the might and speed of [libgit2](http://libgit2.github.com/), a native Git implementation, to the managed world of .NET** +To push to apiiro nuget package: + +``` +dotnet build --configuration Release +rm bin/Packages/Apiiro.LibGit2Sharp.*.nupkg +dotnet pack --configuration Release +dotnet nuget push bin/Packages/Apiiro.LibGit2Sharp.*.nupkg --source "github" --skip-duplicate --no-symbols +``` + ## Online resources - [NuGet package](http://nuget.org/List/Packages/LibGit2Sharp)