Skip to content

Commit ef03ae3

Browse files
authored
Merge pull request #29 from pjbgf/v6
Bump module to v6 plus general improvements
2 parents 02133d5 + 1fd774f commit ef03ae3

17 files changed

+108
-719
lines changed

.github/workflows/codeql.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ jobs:
2525

2626
steps:
2727
- name: Checkout code
28-
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
28+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2929

3030
# Initializes the CodeQL tools for scanning.
3131
- name: Initialize CodeQL
32-
uses: github/codeql-action/init@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
32+
uses: github/codeql-action/init@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
3333
with:
3434
languages: ${{ matrix.language }}
3535
# xref: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
@@ -40,6 +40,6 @@ jobs:
4040
run: go build ./...
4141

4242
- name: Perform CodeQL Analysis
43-
uses: github/codeql-action/analyze@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
43+
uses: github/codeql-action/analyze@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
4444
with:
4545
category: "/language:${{matrix.language}}"

.github/workflows/scorecard.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Scorecard supply-chain security
2+
on:
3+
# For Branch-Protection check. Only the default branch is supported. See
4+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
5+
branch_protection_rule:
6+
# To guarantee Maintained check is occasionally updated. See
7+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
8+
schedule:
9+
- cron: '20 5 * * 0'
10+
push:
11+
branches: [ "main" ]
12+
13+
# Declare default permissions as read only.
14+
permissions: read-all
15+
16+
jobs:
17+
analysis:
18+
name: Scorecard analysis
19+
runs-on: ubuntu-latest
20+
permissions:
21+
# Needed to upload the results to code-scanning dashboard.
22+
security-events: write
23+
# Needed to publish results and get a badge (see publish_results below).
24+
id-token: write
25+
26+
steps:
27+
- name: "Checkout code"
28+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
29+
with:
30+
persist-credentials: false
31+
32+
- name: "Run analysis"
33+
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
34+
with:
35+
results_file: results.sarif
36+
results_format: sarif
37+
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
38+
# - you want to enable the Branch-Protection check on a *public* repository
39+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
40+
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
41+
42+
# Public repositories:
43+
# - Publish results to OpenSSF REST API for easy access by consumers
44+
# - Allows the repository to include the Scorecard badge.
45+
# - See https://github.com/ossf/scorecard-action#publishing-results.
46+
publish_results: true
47+
48+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
49+
# format to the repository Actions tab.
50+
- name: "Upload artifact"
51+
uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20
52+
with:
53+
name: SARIF file
54+
path: results.sarif
55+
retention-days: 5
56+
57+
# Upload the results to GitHub's code scanning dashboard (optional).
58+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
59+
- name: "Upload to code-scanning"
60+
uses: github/codeql-action/upload-sarif@v3
61+
with:
62+
sarif_file: results.sarif

.github/workflows/test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
go-version: [1.21.x, 1.22.x, 1.23.x]
14+
go-version: [1.22.x, 1.23.x, 1.24.x]
1515
platform: [ubuntu-latest, macos-latest, windows-latest]
1616

1717
permissions:
@@ -20,10 +20,10 @@ jobs:
2020
runs-on: ${{ matrix.platform }}
2121
steps:
2222
- name: Checkout code
23-
uses: actions/checkout@v4
23+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2424

2525
- name: Install Go
26-
uses: actions/setup-go@v5
26+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
2727
with:
2828
go-version: ${{ matrix.go-version }}
2929

.golangci.yaml

-6
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ linters:
66
enable-all: true
77
disable:
88
- depguard
9-
- err113
10-
- execinquery
11-
- exhaustruct
12-
- exportloopref
13-
- funlen
14-
- gomnd
159
- ireturn
1610
- mnd
1711
- varnamelen

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GOCMD = go
22
GOTEST = $(GOCMD) test
33

4-
GOLANGCI_VERSION ?= v1.62.2
4+
GOLANGCI_VERSION ?= v1.64.5
55
TOOLS_BIN := $(shell mkdir -p build/tools && realpath build/tools)
66

77
GOLANGCI = $(TOOLS_BIN)/golangci-lint-$(GOLANGCI_VERSION)

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# go-git-fixtures
1+
# go-git-fixtures [![GoDoc](https://godoc.org/gopkg.in/go-git/go-git-fixtures.v6?status.svg)](https://pkg.go.dev/github.com/go-git/go-git-fixtures/v6) [![Test](https://github.com/go-git/go-git-fixtures/workflows/Test/badge.svg)](https://github.com/go-git/go-git-fixtures/actions?query=workflow%3ATest) [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/go-git/go-git-fixtures/badge)](https://scorecard.dev/viewer/?uri=github.com/go-git/go-git-fixtures)
22

33
git repository fixtures used by [go-git](https://github.com/go-git/go-git)
44

fixtures.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import (
99
"strings"
1010
"testing"
1111

12-
"github.com/go-git/go-billy/v5"
13-
"github.com/go-git/go-git-fixtures/v5/internal/embedfs"
12+
"github.com/go-git/go-billy/v6"
13+
"github.com/go-git/go-billy/v6/embedfs"
1414
"github.com/go-git/go-git-fixtures/v5/internal/tgz"
1515
)
1616

1717
//nolint:gochecknoglobals
18-
var Filesystem = embedfs.New(&data, "data")
18+
var Filesystem = embedfs.New(&data)
1919

2020
//go:embed data
2121
var data embed.FS
@@ -304,8 +304,8 @@ func (f *Fixture) Clone() *Fixture {
304304
PackfileHash: f.PackfileHash,
305305
WorktreeHash: f.WorktreeHash,
306306
ObjectsCount: f.ObjectsCount,
307+
Tags: slices.Clone(f.Tags),
307308
}
308-
nf.Tags = slices.Clone(f.Tags)
309309

310310
return nf
311311
}

fixtures_options.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package fixtures
22

33
import (
4-
"github.com/go-git/go-billy/v5"
5-
"github.com/go-git/go-billy/v5/osfs"
4+
"github.com/go-git/go-billy/v6"
5+
"github.com/go-git/go-billy/v6/osfs"
66
"github.com/go-git/go-git-fixtures/v5/internal/tgz"
77
)
88

fixtures_test.go

-5
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ func TestByTag(t *testing.T) {
9696
}
9797

9898
for _, tc := range tests {
99-
tc := tc
100-
10199
t.Run(tc.tag, func(t *testing.T) {
102100
t.Parallel()
103101

@@ -133,8 +131,6 @@ func TestByURL(t *testing.T) {
133131
}
134132

135133
for _, tc := range tests {
136-
tc := tc
137-
138134
t.Run(tc.URL, func(t *testing.T) {
139135
t.Parallel()
140136

@@ -148,7 +144,6 @@ func TestIdx(t *testing.T) {
148144
t.Parallel()
149145

150146
for i, f := range fixtures.ByTag("packfile") {
151-
f := f
152147
t.Run("#"+strconv.Itoa(i), func(t *testing.T) {
153148
t.Parallel()
154149

go.mod

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
module github.com/go-git/go-git-fixtures/v5
22

33
// go-git supports the last 3 stable Go versions.
4-
go 1.21
4+
go 1.22
55

66
require (
7-
github.com/go-git/go-billy/v5 v5.6.2
7+
github.com/go-git/go-billy/v6 v6.0.0-20250226231054-855d56b95681
88
github.com/stretchr/testify v1.10.0
99
)
1010

1111
require (
12-
github.com/cyphar/filepath-securejoin v0.3.6 // indirect
12+
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
1313
github.com/davecgh/go-spew v1.1.1 // indirect
1414
github.com/pmezard/go-difflib v1.0.0 // indirect
15-
golang.org/x/sys v0.29.0 // indirect
15+
golang.org/x/sys v0.30.0 // indirect
1616
gopkg.in/yaml.v3 v3.0.1 // indirect
1717
)

go.sum

+7-24
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,16 @@
1-
github.com/cyphar/filepath-securejoin v0.3.6 h1:4d9N5ykBnSp5Xn2JkhocYDkOpURL/18CYMpo6xB9uWM=
2-
github.com/cyphar/filepath-securejoin v0.3.6/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI=
1+
github.com/cyphar/filepath-securejoin v0.4.1 h1:JyxxyPEaktOD+GAnqIqTf9A8tHyAG22rowi7HkoSU1s=
2+
github.com/cyphar/filepath-securejoin v0.4.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI=
33
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
44
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5-
github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UNbRM=
6-
github.com/go-git/go-billy/v5 v5.6.2/go.mod h1:rcFC2rAsp/erv7CMz9GczHcuD0D32fWzH+MJAU+jaUU=
7-
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
8-
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
9-
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
10-
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
11-
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
12-
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
13-
github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k=
14-
github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY=
5+
github.com/go-git/go-billy/v6 v6.0.0-20250226231054-855d56b95681 h1:dEJLKk2KlPXJHsKo9Yowx/Z3qaj66ylcugbnNl+LZsQ=
6+
github.com/go-git/go-billy/v6 v6.0.0-20250226231054-855d56b95681/go.mod h1:HSPUM9l9AmLqMQiaJuOonBGMV+UQpncqo07ys+z3VBs=
157
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
168
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
17-
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
18-
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
199
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
2010
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
21-
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8=
22-
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
23-
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
24-
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
25-
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
26-
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
27-
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
28-
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
11+
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
12+
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
13+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
2914
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
30-
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
31-
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
3215
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
3316
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 commit comments

Comments
 (0)