Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update libgit2 to v1.7.0 #3

Merged
merged 1 commit into from
Aug 3, 2023
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
branch: [ 'release-1.5', 'release-1.3', 'release-1.2', 'release-1.1', 'release-1.0', 'release-0.28', 'release-0.27' ]
branch: [ 'release-1.6', 'release-1.5', 'release-1.3', 'release-1.2', 'release-1.1', 'release-1.0', 'release-0.28', 'release-0.27' ]

runs-on: ubuntu-20.04

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
fail-fast: false
matrix:
libgit2:
- 'v1.6.4'
- 'v1.7.0'
name: Go (system-wide, dynamic)

runs-on: ubuntu-20.04
Expand Down
4 changes: 2 additions & 2 deletions Build_bundled_static.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ package git
#cgo CFLAGS: -DLIBGIT2_STATIC
#include <git2.h>

#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 6 || LIBGIT2_VER_MINOR > 6
# error "Invalid libgit2 version; this git2go supports libgit2 v1.6.x"
#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 7 || LIBGIT2_VER_MINOR > 7
# error "Invalid libgit2 version; this git2go supports libgit2 v1.7.x"
#endif
*/
import "C"
4 changes: 2 additions & 2 deletions Build_system_dynamic.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ package git
#cgo CFLAGS: -DLIBGIT2_DYNAMIC
#include <git2.h>

#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 6 || LIBGIT2_VER_MINOR > 6
# error "Invalid libgit2 version; this git2go supports libgit2 v1.6.x"
#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 7 || LIBGIT2_VER_MINOR > 7
# error "Invalid libgit2 version; this git2go supports libgit2 v1.7.x"
#endif
*/
import "C"
4 changes: 2 additions & 2 deletions Build_system_static.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ package git
#cgo CFLAGS: -DLIBGIT2_STATIC
#include <git2.h>

#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 6 || LIBGIT2_VER_MINOR > 6
# error "Invalid libgit2 version; this git2go supports libgit2 v1.6.x"
#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 7 || LIBGIT2_VER_MINOR > 7
# error "Invalid libgit2 version; this git2go supports libgit2 v1.7.x"
#endif
*/
import "C"
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Due to the fact that Go 1.11 module versions have semantic meaning and don't nec

| libgit2 | git2go |
|---------|---------------|
| main | (will be v36) |
| main | (will be v37) |
| 1.7 | v36 |
| 1.6 | v35 |
| 1.5 | v34 |
| 1.3 | v33 |
Expand All @@ -24,10 +25,10 @@ Due to the fact that Go 1.11 module versions have semantic meaning and don't nec
You can import them in your project with the version's major number as a suffix. For example, if you have libgit2 v1.2 installed, you'd import git2go v35 with:

```sh
go get github.com/libgit2/git2go/v35
go get github.com/libgit2/git2go/v36
```
```go
import "github.com/libgit2/git2go/v35"
import "github.com/libgit2/git2go/v36"
```

which will ensure there are no sudden changes to the API.
Expand All @@ -51,7 +52,7 @@ This project wraps the functionality provided by libgit2. If you're using a vers
When linking dynamically against a released version of libgit2, install it via your system's package manager. CGo will take care of finding its pkg-config file and set up the linking. Import via Go modules, e.g. to work against libgit2 v1.2

```go
import "github.com/libgit2/git2go/v35"
import "github.com/libgit2/git2go/v36"
```

### Versioned branch, static linking
Expand Down Expand Up @@ -81,7 +82,7 @@ In order to let Go pass the correct flags to `pkg-config`, `-tags static` needs

One thing to take into account is that since Go expects the `pkg-config` file to be within the same directory where `make install-static` was called, so the `go.mod` file may need to have a [`replace` directive](https://github.com/golang/go/wiki/Modules#when-should-i-use-the-replace-directive) so that the correct setup is achieved. So if `git2go` is checked out at `$GOPATH/src/github.com/libgit2/git2go` and your project at `$GOPATH/src/github.com/my/project`, the `go.mod` file of `github.com/my/project` might need to have a line like

replace github.com/libgit2/git2go/v35 => ../../libgit2/git2go
replace github.com/libgit2/git2go/v36 => ../../libgit2/git2go

Parallelism and network operations
----------------------------------
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/libgit2/git2go/v35
module github.com/libgit2/git2go/v36

go 1.13

Expand Down
2 changes: 1 addition & 1 deletion vendor/libgit2
Submodule libgit2 updated 358 files
Loading