Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 1 addition & 60 deletions 61 .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,63 +29,4 @@ jobs:
with:
name: NuGet packages
path: bin/Packages/
retention-days: 7
test:
name: Test / ${{ matrix.os }} / ${{ matrix.arch }} / ${{ matrix.tfm }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
arch: [ amd64 ]
os: [ windows-2019, macos-11 ]
tfm: [ net472, net6.0, net7.0 ]
exclude:
- os: macos-11
tfm: net472
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3.5.0
with:
fetch-depth: 0
- name: Install .NET SDK
uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: |
7.0.x
6.0.x
- name: Run ${{ matrix.tfm }} tests
run: dotnet test LibGit2Sharp.sln --configuration Release --framework ${{ matrix.tfm }} --logger "GitHubActions" /p:ExtraDefine=LEAKS_IDENTIFYING
test-linux:
name: Test / ${{ matrix.distro }} / ${{ matrix.arch }} / ${{ matrix.tfm }}
runs-on: ubuntu-22.04
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'
include:
- sdk: '6.0'
tfm: net6.0
- sdk: '7.0'
tfm: net7.0
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3.5.0
with:
fetch-depth: 0
- name: Setup QEMU
if: matrix.arch == 'arm64'
run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
- name: Run ${{ matrix.tfm }} tests
run: |
git_command="git config --global --add safe.directory /app"
test_command="dotnet test LibGit2Sharp.sln --configuration Release -p:TargetFrameworks=${{ matrix.tfm }} --logger "GitHubActions" -p:ExtraDefine=LEAKS_IDENTIFYING"
docker run -t --rm --platform linux/${{ matrix.arch }} -v "$PWD:/app" gittools/build-images:${{ matrix.distro }}-sdk-${{ matrix.sdk }} sh -c "$git_command && $test_command"

retention-days: 7
7 changes: 4 additions & 3 deletions 7 LibGit2Sharp/LibGit2Sharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
<PropertyGroup>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Description>LibGit2Sharp brings all the might and speed of libgit2, a native Git implementation, to the managed world of .NET</Description>
<Description>LibGit2Sharp-evolvedlight brings all the might and speed of libgit2, a native Git implementation, to the managed world of .NET</Description>
<Company>LibGit2Sharp contributors</Company>
<Copyright>Copyright © LibGit2Sharp contributors</Copyright>
<PackageTags>libgit2 git</PackageTags>
<PackageProjectUrl>https://github.com/libgit2/libgit2sharp/</PackageProjectUrl>
<PackageProjectUrl>https://github.com/evolvedlight/libgit2sharp/</PackageProjectUrl>
<Authors>LibGit2Sharp contributors</Authors>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<PackageId>LibGit2Sharp-evolvedlight</PackageId>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<DebugType>embedded</DebugType>
<SignAssembly>true</SignAssembly>
Expand Down Expand Up @@ -43,7 +44,7 @@

<Target Name="SetNuspecProperties" BeforeTargets="GenerateNuspec">
<PropertyGroup>
<PackageReleaseNotes>https://github.com/libgit2/libgit2sharp/blob/$(SourceRevisionId)/CHANGES.md</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/evolvedlight/libgit2sharp/blob/$(SourceRevisionId)/CHANGES.md</PackageReleaseNotes>
</PropertyGroup>
</Target>

Expand Down
1 change: 1 addition & 0 deletions 1 LibGit2Sharp/Network.cs
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ public virtual void Push(Remote remote, IEnumerable<string> pushRefSpecs, PushOp
PackbuilderDegreeOfParallelism = pushOptions.PackbuilderDegreeOfParallelism,
RemoteCallbacks = gitCallbacks,
ProxyOptions = new GitProxyOptions { Version = 1 },
CustomHeaders = pushOptions.CustomHeaders?.Length > 0 ? GitStrArrayManaged.BuildFrom(pushOptions.CustomHeaders) : new GitStrArrayManaged()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is null better than new GitStrArrayManaged() here?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CustomHeaders field is of type GitStrArrayManaged, which is a struct type so non-nullable value type. So not without some other impacting modifications I think.

Copy link
Contributor

@James-LG James-LG Jul 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitStrArrayManaged needs to be disposed. I have a similar PR that does that here #2052 by following the pattern set by GitFetchOptionsWrapper.

});
}
}
Expand Down
21 changes: 21 additions & 0 deletions 21 LibGit2Sharp/PushOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,27 @@ public sealed class PushOptions
/// </summary>
public int PackbuilderDegreeOfParallelism { get; set; }

/// <summary>
/// Get/Set the custom headers.
///
/// <para>
/// This allows you to set custom headers (e.g. X-Forwarded-For,
/// X-Request-Id, etc),
/// </para>
/// </summary>
/// <remarks>
/// Libgit2 sets some headers for HTTP requests (User-Agent, Host,
/// Accept, Content-Type, Transfer-Encoding, Content-Length, Accept) that
/// cannot be overriden.
/// </remarks>
/// <example>
/// var fetchOptions - new FetchOptions() {
/// CustomHeaders = new String[] {"X-Request-Id: 12345"}
/// };
/// </example>
/// <value>The custom headers string array</value>
public string[] CustomHeaders { get; set; }

/// <summary>
/// Delegate to report errors when updating references on the remote.
/// </summary>
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.