Skip to content

Commit 2dd52fe

Browse files
committed
Merge remote-tracking branch 'origin/master'
# Conflicts: # LibGit2Sharp/Core/NativeMethods.cs
2 parents 064a053 + cb58177 commit 2dd52fe

File tree

357 files changed

+6340
-2645
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

357 files changed

+6340
-2645
lines changed

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ trim_trailing_whitespace = true
1010
insert_final_newline = true
1111

1212
; Not change VS generated files
13-
[*.{sln,csroj}]
13+
[*.{sln,csproj}]
1414
trim_trailing_whitespace = false
1515
insert_final_newline = false
1616

17-
[*.{props,targets}]
17+
[*.{props,targets,csproj,config}]
1818
indent_size = 2

.github/ISSUE_TEMPLATE

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
You are opening a _bug report_ against the LibGit2Sharp project: we
2+
use GitHub Issues for tracking bug reports and feature requests. If
3+
you have a question about an API or usage, please ask on StackOverflow:
4+
http://stackoverflow.com/questions/tagged/libgit2sharp.
5+
6+
Otherwise, to report a bug, please fill out the reproduction steps
7+
(below) and delete these introductory paragraphs. Thanks!
8+
9+
### Reproduction steps
10+
11+
### Expected behavior
12+
13+
### Actual behavior
14+
15+
### Version of LibGit2Sharp (release number or SHA1)
16+
17+
### Operating system(s) tested; .NET runtime tested

.github/workflows/ci.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: [master, release-*]
5+
tags:
6+
- '[0-9]+.[0-9]+.[0-9]+'
7+
- '[0-9]+.[0-9]+.[0-9]+-*'
8+
pull_request:
9+
workflow_dispatch:
10+
env:
11+
DOTNET_NOLOGO: true
12+
jobs:
13+
build:
14+
name: Build
15+
runs-on: ubuntu-22.04
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4.1.2
19+
with:
20+
fetch-depth: 0
21+
- name: Install .NET SDK
22+
uses: actions/setup-dotnet@v4.0.0
23+
with:
24+
dotnet-version: 9.0.x
25+
- name: Build
26+
run: dotnet build LibGit2Sharp.sln --configuration Release
27+
- name: Upload packages
28+
uses: actions/upload-artifact@v4.3.1
29+
with:
30+
name: NuGet packages
31+
path: artifacts/package/
32+
retention-days: 7
33+
- name: Verify trimming compatibility
34+
run: dotnet publish TrimmingTestApp
35+
test:
36+
name: Test / ${{ matrix.os }} / ${{ matrix.arch }} / ${{ matrix.tfm }}
37+
runs-on: ${{ matrix.os }}
38+
strategy:
39+
matrix:
40+
arch: [ x64 ]
41+
os: [ windows-2019, windows-2022, macos-13 ]
42+
tfm: [ net472, net8.0, net9.0 ]
43+
exclude:
44+
- os: macos-13
45+
tfm: net472
46+
include:
47+
- arch: arm64
48+
os: macos-14
49+
tfm: net8.0
50+
- arch: arm64
51+
os: macos-14
52+
tfm: net9.0
53+
fail-fast: false
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@v4.1.2
57+
with:
58+
fetch-depth: 0
59+
- name: Install .NET SDK
60+
uses: actions/setup-dotnet@v4.0.0
61+
with:
62+
dotnet-version: |
63+
9.0.x
64+
8.0.x
65+
- name: Run ${{ matrix.tfm }} tests
66+
run: dotnet test LibGit2Sharp.sln --configuration Release --framework ${{ matrix.tfm }} --logger "GitHubActions" /p:ExtraDefine=LEAKS_IDENTIFYING
67+
test-linux:
68+
name: Test / ${{ matrix.distro }} / ${{ matrix.arch }} / ${{ matrix.tfm }}
69+
runs-on: ${{ matrix.runnerImage }}
70+
strategy:
71+
matrix:
72+
arch: [ amd64, arm64 ]
73+
distro: [ alpine.3.17, alpine.3.18, alpine.3.19, alpine.3.20, centos.stream.9, debian.12, fedora.40, ubuntu.20.04, ubuntu.22.04, ubuntu.24.04 ]
74+
sdk: [ '8.0', '9.0' ]
75+
exclude:
76+
- distro: alpine.3.17
77+
sdk: '9.0'
78+
- distro: alpine.3.18
79+
sdk: '9.0'
80+
- distro: alpine.3.19
81+
sdk: '9.0'
82+
include:
83+
- sdk: '8.0'
84+
tfm: net8.0
85+
- sdk: '9.0'
86+
tfm: net9.0
87+
- arch: amd64
88+
runnerImage: ubuntu-22.04
89+
- arch: arm64
90+
runnerImage: ubuntu-22.04-arm
91+
fail-fast: false
92+
steps:
93+
- name: Checkout
94+
uses: actions/checkout@v4.1.2
95+
with:
96+
fetch-depth: 0
97+
- name: Run ${{ matrix.tfm }} tests
98+
run: |
99+
git_command="git config --global --add safe.directory /app"
100+
test_command="dotnet test LibGit2Sharp.sln --configuration Release -p:TargetFrameworks=${{ matrix.tfm }} --logger "GitHubActions" -p:ExtraDefine=LEAKS_IDENTIFYING"
101+
docker run -t --rm --platform linux/${{ matrix.arch }} -v "$PWD:/app" -e OPENSSL_ENABLE_SHA1_SIGNATURES=1 gittools/build-images:${{ matrix.distro }}-sdk-${{ matrix.sdk }} sh -c "$git_command && $test_command"
102+

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ _ReSharper*/
3838
*.DotSettings
3939

4040
_NCrunch_LibGit2Sharp/
41+
artifacts/
42+
worktree.playlist

.travis.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

CHANGES.md

Lines changed: 105 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,110 @@
11
# LibGit2Sharp Changes
22

3-
**LibGit2Sharp brings all the might and speed of libgit2, a native Git implementation, to the managed world of .Net and Mono.**
3+
## v0.31 - ([diff](https://github.com/libgit2/libgit2sharp/compare/0.30.0..0.31.0))
44

5-
- Source code: <https://github.com/libgit2/libgit2sharp>
6-
- NuGet package: <http://nuget.org/List/Packages/LibGit2Sharp>
7-
- Issue tracker: <https://github.com/libgit2/libgit2sharp/issues>
8-
- @libgit2sharp: <http://twitter.com/libgit2sharp>
9-
- CI servers:
10-
- Windows (x86/amd64): <https://ci.appveyor.com/project/libgit2/libgit2sharp>
11-
- Linux/Mac OS X: <https://travis-ci.org/libgit2/libgit2sharp>
5+
### Changes
6+
- This release includes [libgit2 v1.8.4](https://github.com/libgit2/libgit2/releases/tag/v1.8.4).
7+
- SSH is now supported through [libgit2's support for OpenSSH](https://github.com/libgit2/libgit2/pull/6617).
8+
- The ppc64le architecture is now supported on Linux.
9+
- .NET 6 has reached end of support, so LibGit2Sharp now targets `net472` and `net8.0`.
10+
11+
### Additions
12+
- Adds Depth to FetchOptions allowing for shallow cloning [#2070](https://github.com/libgit2/libgit2sharp/pull/2070)
13+
- Make owner validation configurable [#2093](https://github.com/libgit2/libgit2sharp/pull/2093)
14+
- Add a CloneOptions constructor that takes a FetchOptions [#2132](https://github.com/libgit2/libgit2sharp/pull/2132)
15+
16+
### Fixes
17+
- TreeDefinition.Remove fails to remove unwrapped trees [#1869](https://github.com/libgit2/libgit2sharp/issues/1869)
18+
- ObjectDatabase.Write<T>(Stream stream...) overload does not respect T [#2071](https://github.com/libgit2/libgit2sharp/issues/2071)
19+
- Repository.Worktrees.Add leaves now worktree empty [#2037](https://github.com/libgit2/libgit2sharp/issues/2037)
1220

13-
## v0.24 + 1
21+
## v0.30 - ([diff](https://github.com/libgit2/libgit2sharp/compare/0.29.0..0.30.0))
22+
23+
### Changes
24+
- This release includes [libgit2 v1.7.2](https://github.com/libgit2/libgit2/releases/tag/v1.7.2).
25+
- Updates for trimming compatibility [#2084](https://github.com/libgit2/libgit2sharp/pull/2084)
26+
- Updates for .NET 8 [#2085](https://github.com/libgit2/libgit2sharp/pull/2085)
27+
28+
## v0.29 - ([diff](https://github.com/libgit2/libgit2sharp/compare/0.28.0..0.29.0))
29+
30+
### Changes
31+
- This release includes [libgit2 v1.7.1](https://github.com/libgit2/libgit2/releases/tag/v1.7.1).
32+
- CI changes for the native binaries has removed support for CentOS 7. See [#2066](https://github.com/libgit2/libgit2sharp/pull/2066) for details.
1433

1534
### Additions
35+
- Add proxy options [#2065](https://github.com/libgit2/libgit2sharp/pull/2065)
36+
- See PR for details, including some breaking changes to `CloneOptions` and `SubmoduleUpdateOptions`
37+
38+
## v0.28 - ([diff](https://github.com/libgit2/libgit2sharp/compare/0.27.2..0.28.0))
39+
40+
### Additions
41+
- Add CustomHeaders to PushOptions [#2052](https://github.com/libgit2/libgit2sharp/pull/2052)
42+
43+
## v0.27.2 - ([diff](https://github.com/libgit2/libgit2sharp/compare/0.27.1..0.27.2))
44+
45+
### Changes
46+
- This release includes [libgit2 v1.6.4](https://github.com/libgit2/libgit2/releases/tag/v1.6.4).
47+
48+
### Fixes
49+
- Can't access GIT config (Repository.Config) since v0.27.0 [#2031](https://github.com/libgit2/libgit2sharp/issues/2031)
50+
51+
## v0.27.1 - ([diff](https://github.com/libgit2/libgit2sharp/compare/0.27.0..0.27.1))
52+
53+
### Fixes
54+
- AssemblyVersion of v0.27.0 is `0.0.0.0`, which is lower than the AssemblyVersion of the v0.26.x releases. [#2030](https://github.com/libgit2/libgit2sharp/pull/2030)
55+
56+
## v0.27 - ([diff](https://github.com/libgit2/libgit2sharp/compare/v0.26..0.27.0))
57+
58+
### Changes
59+
- LibGit2Sharp now targets .NET Framework 4.7.2 and .NET 6.
60+
- This release includes [libgit2 v1.6.3](https://github.com/libgit2/libgit2/releases/tag/v1.6.3).
61+
- Changes to the native binaries let LibGit2Sharp work on all [.NET 6 supported OS versions and architectures](https://github.com/dotnet/core/blob/main/release-notes/6.0/supported-os.md).
62+
- `GlobalSetings.NativeLibraryPath` used to automatically append architecture to the path when running on .NET Framework. This behavior has been removed to make it consistent. [#1918](https://github.com/libgit2/libgit2sharp/pull/1918)
63+
64+
### Additions
65+
- Add support for adding and clearing multi-valued configuration [#1720](https://github.com/libgit2/libgit2sharp/pull/1720)
66+
- added lines and deleted lines in content changes [#1790](https://github.com/libgit2/libgit2sharp/pull/1790)
67+
- Set / get supported extensions [#1908](https://github.com/libgit2/libgit2sharp/pull/1908)
68+
- Simplify dealing with missing git objects [#1909](https://github.com/libgit2/libgit2sharp/pull/1909)
69+
- Throw NotFoundException if trees are missing when computing diff [#1936](https://github.com/libgit2/libgit2sharp/pull/1936)
70+
71+
### Fixes
72+
- Adjust GitStatusOptions to match structure of native libgit2 [#1884](https://github.com/libgit2/libgit2sharp/pull/1884)
73+
- Update git_worktree_add_options struct to include ref pointer [#1890](https://github.com/libgit2/libgit2sharp/pull/1890)
74+
- Fix git_remote_connect not throwing on non-zero result [#1913](https://github.com/libgit2/libgit2sharp/pull/1913)
75+
- Fix incorrect information in exceptions [#1919](https://github.com/libgit2/libgit2sharp/pull/1919)
76+
- Checkout branch looks to remote tracking branches as fallback [#1820](https://github.com/libgit2/libgit2sharp/pull/1820)
77+
- Fixed calling into native libgit2 on osx-arm64 [#1955](https://github.com/libgit2/libgit2sharp/pull/1955)
78+
79+
## v0.26 - ([diff](https://github.com/libgit2/libgit2sharp/compare/v0.25..v0.26))
80+
81+
### Additions
82+
83+
* Add `CherryPickCommitIntoIndex` to `ObjectDatabase`
84+
* The underlying native library (libgit2) now no longer relies on libcurl
85+
* The underlying native library now no longer relies on zlib
86+
* Add `IndentHeuristic` option to `CompareOptions`
87+
88+
## v0.25 - ([diff](https://github.com/libgit2/libgit2sharp/compare/v0.24..v0.25))
89+
90+
LibGit2Sharp is now .NET Core 2.0+ and .NET Framework compatible.
91+
92+
### Additions
93+
94+
- `GitObject` now has a `Peel` method that will let you peel (for example)
95+
a `Tag` to a `Tree`.
96+
- `MergeOptions` now includes an option to `IgnoreWhitespaceChanges`.
97+
- `TreeDefinition` can now `Add` an object with only the ID, which allows
98+
users of large files to add entries without realizing a `Blob`.
99+
- `ObjectDatabase` can now `Write` a `Stream`, which allows users of
100+
large files to stream an object into storage without loading it into
101+
memory.
102+
- `ObjectDatabase` can now `MergeCommitsIntoIndex` allowing users to perform
103+
an in-memory merge that produces an `Index` structure with conflicts.
104+
- Users can enable or disable dependent object existence checks when
105+
creating new objects with `GlobalSettings.SetEnableStrictObjectCreation`
106+
- Users can enable or disable `ofs_delta` support with
107+
`GlobalSettings.SetEnableOfsDelta`
16108

17109
### Changes
18110

@@ -21,11 +113,15 @@
21113
the `StatusOptions.RecurseUntrackedDirs` options.
22114
- Status now does not show the ignored files by default. To retrieve
23115
ignored files, include the `StatusOptions.IncludeIgnored` option.
116+
- `Commands.Pull` can now provide a `null` value for `PullOptions`,
117+
which indicates that default values should be used.
24118

25119
### Fixes
26120

27121
- The exception thrown when the native library cannot be loaded is now
28122
able to be caught and will no longer crash the process.
123+
- Getting the `Notes` collection from a `Repository` no longer throws an
124+
exception when the repository has no notes.
29125

30126
## v0.24 - ([diff](https://github.com/libgit2/libgit2sharp/compare/v0.23..v0.24))
31127

CONTRIBUTING.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ We love Pull Requests! Your contributions help make LibGit2Sharp great.
44

55
## Getting Started
66

7-
So you want to contribute to LibGit2Sharp. Great! Contributions take many forms from
7+
So you want to contribute to LibGit2Sharp. Great! Contributions take many forms from
88
submitting issues, writing documentation, to making code changes. We welcome it all.
99

1010
But first things first...
@@ -14,18 +14,25 @@ But first things first...
1414
* Clearly describe the issue including steps to reproduce when it is a bug.
1515
* Make sure you fill in the earliest version that you know has the issue.
1616
* Fork the repository on GitHub, then clone it using your favorite Git client.
17-
* Make sure the project builds and all tests pass on your machine by running
18-
the `build.libgit2sharp.cmd` script on Windows or `build.libgit2sharp.sh` on Linux/Mac.
17+
* Make sure the project builds and all tests pass on your machine by running
18+
the `buildandtest.cmd` script on Windows or `buildandtest.sh` on Linux/Mac.
1919

2020
## LibGit2
2121

2222
LibGit2Sharp brings all the might and speed of libgit2, a native Git implementation, to the managed world of .Net and Mono.
23-
LibGit2 is a git submodule referencing the [libgit2 project](https://github.com/libgit2/libgit2). To learn more about
23+
LibGit2 is a git submodule referencing the [libgit2 project](https://github.com/libgit2/libgit2). To learn more about
2424
submodules read [here](http://git-scm.com/book/en/v2/Git-Tools-Submodules).
2525
To build libgit2 see [here](https://github.com/libgit2/libgit2sharp/wiki/How-to-build-x64-libgit2-and-LibGit2Sharp).
2626

2727
## Making Changes
2828

29+
Make sure you have the required .NET Core SDK and runtimes installed.
30+
The easiest way to do this is run our `tools\Install-DotNetSdk.ps1` script.
31+
Using the `-InstallLocality Machine` switch requires elevation but ensures
32+
that Visual Studio will be able to load the solution even when launched from a shortcut.
33+
34+
Then proceed to:
35+
2936
* Create a topic branch off master (don't work directly on master).
3037
* Implement your feature or fix your bug. Please following existing coding styles and do not introduce new ones.
3138
* Make atomic, focused commits with good commit messages.
@@ -42,10 +49,10 @@ Some things that will increase the chance that your pull request is accepted.
4249
* Following existing code conventions.
4350
* Including unit tests that would otherwise fail without the patch, but pass after applying it.
4451
* Updating the documentation and tests that are affected by the contribution.
45-
* If code from elsewhere is used, proper credit and a link to the source should exist in the code comments.
52+
* If code from elsewhere is used, proper credit and a link to the source should exist in the code comments.
4653
Then licensing issues can be checked against LibGit2Sharp's very permissive MIT based open source license.
4754
* Having a configured git client that converts line endings to LF. [See here.](https://help.github.com/articles/dealing-with-line-endings/).
4855
# Additional Resources
4956

5057
* [General GitHub documentation](http://help.github.com/)
51-
* [GitHub pull request documentation](https://help.github.com/articles/using-pull-requests/)
58+
* [GitHub pull request documentation](https://help.github.com/articles/using-pull-requests/)

Directory.Build.props

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
<Project>
22

33
<PropertyGroup>
4+
<EnableNETAnalyzers>true</EnableNETAnalyzers>
45
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
5-
<OutputPath>$(MSBuildThisFileDirectory)bin\$(MSBuildProjectName)\$(Configuration)\</OutputPath>
6-
<BaseIntermediateOutputPath>$(MSBuildThisFileDirectory)obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
6+
<UseArtifactsOutput>true</UseArtifactsOutput>
77
<DefineConstants Condition=" '$(ExtraDefine)' != '' ">$(DefineConstants);$(ExtraDefine)</DefineConstants>
88
</PropertyGroup>
99

10+
<PropertyGroup Condition="'$(CI)' != ''">
11+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
12+
</PropertyGroup>
13+
1014
</Project>

Directory.Build.targets

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)