Skip to content

Commit d41adba

Browse files
fix(tests): replace AddGlob with AddWithOptions to fix go-git v5.19.1… (#1983)
… compatibility <!-- markdownlint-disable MD041 --> #### What this PR does / why we need it Fixes broken update to go-git v1.59.1 **Why it broke:** go-git v5.19.1 added a worktreeFilesystem security wrapper (go-git/go-git#2100). The wrapper rejects components named `.git`. This PR removed the hardening with `AddWithOptions(&git.AddOptions{All: true})` #### Which issue(s) this PR is related to Fixes: #1965 Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
1 parent 5b88451 commit d41adba

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

api/ocm/extensions/accessmethods/git/method_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ var _ = Describe("Method based on Filesystem", func() {
7878
}
7979

8080
wt := Must(repo.Worktree())
81-
Expect(wt.AddGlob("*")).To(Succeed())
81+
Expect(wt.AddWithOptions(&git.AddOptions{All: true})).To(Succeed())
8282
commit := Must(wt.Commit("OCM Test Commit", &git.CommitOptions{
8383
Author: &object.Signature{
8484
Name: "OCM Test",

api/tech/git/resolver_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ var _ = Describe("standard tests with local file repo", func() {
7575
}
7676

7777
wt := Must(repo.Worktree())
78-
Expect(wt.AddGlob("*")).To(Succeed())
78+
Expect(wt.AddWithOptions(&git.AddOptions{All: true})).To(Succeed())
7979
commit = Must(wt.Commit("OCM Test Commit", &git.CommitOptions{
8080
Author: &object.Signature{
8181
Name: "OCM Test",

api/utils/blobaccess/git/access_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ var _ = Describe("git Blob Access", func() {
9292

9393
wt, err := repo.Worktree()
9494
Expect(err).ToNot(HaveOccurred())
95-
Expect(wt.AddGlob("*")).To(Succeed())
95+
Expect(wt.AddWithOptions(&git.AddOptions{All: true})).To(Succeed())
9696
_, err = wt.Commit("OCM Test Commit", &git.CommitOptions{
9797
Author: &object.Signature{
9898
Name: "OCM Test",

0 commit comments

Comments
 (0)