From a033d2fb81e175edc0dae65d7b9260929e245552 Mon Sep 17 00:00:00 2001 From: kane8n Date: Mon, 6 Jan 2025 12:29:00 +0900 Subject: [PATCH] support sparse checkout Signed-off-by: kane8n --- git/gogit/clone.go | 47 ++++- git/gogit/clone_test.go | 372 ++++++++++++++++++++++++++++++++++- git/gogit/go.mod | 10 +- git/gogit/go.sum | 30 ++- git/internal/e2e/go.mod | 8 +- git/internal/e2e/go.sum | 28 +-- git/repository/options.go | 4 + oci/tests/integration/go.mod | 8 +- oci/tests/integration/go.sum | 24 +-- 9 files changed, 467 insertions(+), 64 deletions(-) diff --git a/git/gogit/clone.go b/git/gogit/clone.go index 84026336..feaac2e4 100644 --- a/git/gogit/clone.go +++ b/git/gogit/clone.go @@ -78,7 +78,7 @@ func (g *Client) cloneBranch(ctx context.Context, url, branch string, opts repos RemoteName: git.DefaultRemote, ReferenceName: plumbing.NewBranchReferenceName(branch), SingleBranch: g.singleBranch, - NoCheckout: false, + NoCheckout: len(opts.SparseCheckoutDirectories) != 0, Depth: depth, RecurseSubmodules: recurseSubmodules(opts.RecurseSubmodules), Progress: nil, @@ -110,6 +110,20 @@ func (g *Client) cloneBranch(ctx context.Context, url, branch string, opts repos } } + if len(opts.SparseCheckoutDirectories) != 0 { + w, err := repo.Worktree() + if err != nil { + return nil, fmt.Errorf("unable to open repo worktree: %w", err) + } + err = w.Checkout(&extgogit.CheckoutOptions{ + Branch: ref, + SparseCheckoutDirectories: opts.SparseCheckoutDirectories, + }) + if err != nil { + return nil, fmt.Errorf("unable to sparse checkout branch '%s': %w", branch, err) + } + } + head, err := repo.Head() if err != nil { return nil, fmt.Errorf("unable to resolve HEAD of branch '%s': %w", branch, err) @@ -161,7 +175,7 @@ func (g *Client) cloneTag(ctx context.Context, url, tag string, opts repository. RemoteName: git.DefaultRemote, ReferenceName: plumbing.NewTagReferenceName(tag), SingleBranch: g.singleBranch, - NoCheckout: false, + NoCheckout: len(opts.SparseCheckoutDirectories) != 0, Depth: depth, RecurseSubmodules: recurseSubmodules(opts.RecurseSubmodules), Progress: nil, @@ -182,6 +196,20 @@ func (g *Client) cloneTag(ctx context.Context, url, tag string, opts repository. return nil, fmt.Errorf("unable to clone '%s': %w", url, err) } + if len(opts.SparseCheckoutDirectories) != 0 { + w, err := repo.Worktree() + if err != nil { + return nil, fmt.Errorf("unable to open repo worktree: %w", err) + } + err = w.Checkout(&extgogit.CheckoutOptions{ + Branch: ref, + SparseCheckoutDirectories: opts.SparseCheckoutDirectories, + }) + if err != nil { + return nil, fmt.Errorf("unable to sparse checkout tag '%s': %w", tag, err) + } + } + head, err := repo.Head() if err != nil { return nil, fmt.Errorf("unable to resolve HEAD of tag '%s': %w", tag, err) @@ -222,7 +250,7 @@ func (g *Client) cloneCommit(ctx context.Context, url, commit string, opts repos Auth: authMethod, RemoteName: git.DefaultRemote, SingleBranch: false, - NoCheckout: true, + NoCheckout: len(opts.SparseCheckoutDirectories) != 0, RecurseSubmodules: recurseSubmodules(opts.RecurseSubmodules), Progress: nil, Tags: tagStrategy, @@ -255,8 +283,9 @@ func (g *Client) cloneCommit(ctx context.Context, url, commit string, opts repos return nil, fmt.Errorf("unable to resolve commit object for '%s': %w", commit, err) } err = w.Checkout(&extgogit.CheckoutOptions{ - Hash: cc.Hash, - Force: true, + Hash: cc.Hash, + Force: true, + SparseCheckoutDirectories: opts.SparseCheckoutDirectories, }) if err != nil { return nil, fmt.Errorf("unable to checkout commit '%s': %w", commit, err) @@ -288,7 +317,7 @@ func (g *Client) cloneSemVer(ctx context.Context, url, semverTag string, opts re URL: url, Auth: authMethod, RemoteName: git.DefaultRemote, - NoCheckout: false, + NoCheckout: len(opts.SparseCheckoutDirectories) != 0, Depth: depth, RecurseSubmodules: recurseSubmodules(opts.RecurseSubmodules), Progress: nil, @@ -376,7 +405,8 @@ func (g *Client) cloneSemVer(ctx context.Context, url, semverTag string, opts re return nil, fmt.Errorf("unable to find reference for tag '%s': %w", t, err) } err = w.Checkout(&extgogit.CheckoutOptions{ - Branch: tagRef.Name(), + Branch: tagRef.Name(), + SparseCheckoutDirectories: opts.SparseCheckoutDirectories, }) if err != nil { return nil, fmt.Errorf("unable to checkout tag '%s': %w", t, err) @@ -458,7 +488,8 @@ func recurseSubmodules(recurse bool) extgogit.SubmoduleRescursivity { } func (g *Client) getRemoteHEAD(ctx context.Context, url string, ref plumbing.ReferenceName, - authMethod transport.AuthMethod) (string, error) { + authMethod transport.AuthMethod, +) (string, error) { // ref: https://git-scm.com/docs/git-check-ref-format#_description; point no. 6 if strings.HasPrefix(ref.String(), "/") || strings.HasSuffix(ref.String(), "/") { return "", fmt.Errorf("ref %s is invalid; Git refs cannot begin or end with a slash '/'", ref.String()) diff --git a/git/gogit/clone_test.go b/git/gogit/clone_test.go index a99525e8..ca657f1c 100644 --- a/git/gogit/clone_test.go +++ b/git/gogit/clone_test.go @@ -21,6 +21,7 @@ import ( "errors" "fmt" iofs "io/fs" + "maps" "net" "net/http" "net/http/httptest" @@ -28,6 +29,7 @@ import ( "os" "os/exec" "path/filepath" + "slices" "strings" "testing" "time" @@ -757,6 +759,348 @@ func Test_cloneSubmodule(t *testing.T) { g.Expect(c).To(Equal(len(expectedPaths))) } +func Test_sparseCheckout(t *testing.T) { + repo, repoPath, err := initRepo(t.TempDir()) + if err != nil { + t.Fatal(err) + } + + firstCommit, err := commitFiles(repo, map[string]string{"dir1/branch": "init1", "dir2/branch": "init2", "dir3/branch": "init3"}, time.Now()) + if err != nil { + t.Fatal(err) + } + + if err = createBranch(repo, "test"); err != nil { + t.Fatal(err) + } + + secondCommit, err := commitFiles(repo, map[string]string{"dir1/branch": "second1", "dir2/branch": "second2", "dir3/branch": "second3"}, time.Now()) + if err != nil { + t.Fatal(err) + } + + thirdCommit, err := commitFiles(repo, map[string]string{"dir1/branch": "third1", "dir2/branch": "third2", "dir3/branch": "third3"}, time.Now()) + if err != nil { + t.Fatal(err) + } + _, err = tag(repo, thirdCommit, false, "testtag", time.Now()) + if err != nil { + t.Fatal(err) + } + + fourthCommit, err := commitFiles(repo, map[string]string{"dir1/branch": "fourth1", "dir2/branch": "fourth2", "dir3/branch": "fourth3"}, time.Now()) + if err != nil { + t.Fatal(err) + } + _, err = tag(repo, fourthCommit, true, "annotated", time.Now()) + if err != nil { + t.Fatal(err) + } + + // for semver tests + if err = createBranch(repo, "semver"); err != nil { + t.Fatal(err) + } + + semver1, err := commitFiles(repo, map[string]string{"dir1/branch": "semver1", "dir2/branch": "semver1", "dir3/branch": "semver1"}, time.Now()) + if err != nil { + t.Fatal(err) + } + _, err = tag(repo, semver1, false, "v0.1.0", time.Now()) + if err != nil { + t.Fatal(err) + } + semver2, err := commitFiles(repo, map[string]string{"dir1/branch": "semver2", "dir2/branch": "semver2", "dir3/branch": "semver3"}, time.Now().Add(10*time.Minute)) + if err != nil { + t.Fatal(err) + } + _, err = tag(repo, semver2, true, "v0.1.0+build-1", time.Now().Add(2*time.Hour)) + if err != nil { + t.Fatal(err) + } + semver3, err := commitFiles(repo, map[string]string{"dir1/branch": "semver3", "dir2/branch": "semver3", "dir3/branch": "semver3"}, time.Now().Add(30*time.Minute)) + if err != nil { + t.Fatal(err) + } + _, err = tag(repo, semver3, false, "v0.1.0+build-2", time.Time{}) + if err != nil { + t.Fatal(err) + } + semver4, err := commitFiles(repo, map[string]string{"dir1/branch": "semver4", "dir2/branch": "semver4", "dir3/branch": "semver4"}, time.Now().Add(1*time.Hour)) + if err != nil { + t.Fatal(err) + } + _, err = tag(repo, semver4, false, "v0.1.0+build-3", time.Now().Add(1*time.Hour)) + if err != nil { + t.Fatal(err) + } + semver5, err := commitFiles(repo, map[string]string{"dir1/branch": "semver5", "dir2/branch": "semver5", "dir3/branch": "semver5"}, time.Now()) + if err != nil { + t.Fatal(err) + } + _, err = tag(repo, semver5, true, "0.2.0", time.Now()) + if err != nil { + t.Fatal(err) + } + + _, emptyRepoPath, err := initRepo(t.TempDir()) + if err != nil { + t.Fatal(err) + } + + tests := []struct { + testType string + name string + branch string + commit string + tag string + constraint string + annotatedTag bool + filesCreated map[string]string + lastRevision string + sparseCheckoutDirectories []string + expectedCommit string + expectedFile string + expectedNoCloneFiles []string + expectedConcreteCommit bool + expectedTag string + expectedErr string + expectedEmpty bool + }{ + { + testType: "branch", + name: "Default branch", + branch: "master", + filesCreated: map[string]string{"dir1/branch": "init1"}, + sparseCheckoutDirectories: []string{"dir1"}, + expectedCommit: firstCommit.String(), + expectedConcreteCommit: true, + expectedNoCloneFiles: []string{"dir2/branch", "dir3/branch"}, + }, + { + testType: "branch", + name: "Default branch - checkout multiple directories", + branch: "master", + filesCreated: map[string]string{"dir1/branch": "init1", "dir2/branch": "init2"}, + sparseCheckoutDirectories: []string{"dir1", "dir2"}, + expectedCommit: firstCommit.String(), + expectedConcreteCommit: true, + expectedNoCloneFiles: []string{"dir3/branch"}, + }, + { + testType: "branch", + name: "Other branch - revision has changed", + branch: "test", + filesCreated: map[string]string{"dir2/branch": "fourth2"}, + lastRevision: fmt.Sprintf("master@%s", git.Hash(firstCommit.String()).Digest()), + sparseCheckoutDirectories: []string{"dir2"}, + expectedCommit: fourthCommit.String(), + expectedConcreteCommit: true, + expectedNoCloneFiles: []string{"dir1/branch"}, + }, + { + testType: "branch", + name: "Other branch - revision has changed (legacy)", + branch: "test", + filesCreated: map[string]string{"dir2/branch": "fourth2"}, + lastRevision: fmt.Sprintf("master/%s", firstCommit.String()), + sparseCheckoutDirectories: []string{"dir2"}, + expectedCommit: fourthCommit.String(), + expectedConcreteCommit: true, + expectedNoCloneFiles: []string{"dir1/branch"}, + }, + { + testType: "commit", + name: "Commit", + commit: firstCommit.String(), + filesCreated: map[string]string{"dir1/branch": "init1"}, + sparseCheckoutDirectories: []string{"dir1"}, + expectedCommit: git.HashTypeSHA1 + ":" + firstCommit.String(), + expectedNoCloneFiles: []string{"dir2/branch", "dir3/branch"}, + }, + { + testType: "commit", + name: "Commit - checkout multiple directories", + commit: firstCommit.String(), + filesCreated: map[string]string{"dir1/branch": "init1", "dir2/branch": "init2"}, + sparseCheckoutDirectories: []string{"dir1", "dir2"}, + expectedCommit: git.HashTypeSHA1 + ":" + firstCommit.String(), + expectedNoCloneFiles: []string{"dir3/branch"}, + }, + { + testType: "commit", + name: "Commit in specific branch", + branch: "test", + commit: secondCommit.String(), + filesCreated: map[string]string{"dir1/branch": "second1"}, + sparseCheckoutDirectories: []string{"dir1"}, + expectedCommit: "test@" + git.HashTypeSHA1 + ":" + secondCommit.String(), + expectedNoCloneFiles: []string{"dir2/branch"}, + }, + { + testType: "tag", + name: "Tag", + annotatedTag: false, + tag: "testtag", + filesCreated: map[string]string{"dir1/branch": "third1"}, + sparseCheckoutDirectories: []string{"dir1"}, + expectedCommit: thirdCommit.String(), + expectedNoCloneFiles: []string{"dir2/branch", "dir3/branch"}, + }, + { + testType: "tag", + name: "Tag - checkout multiple directories", + annotatedTag: false, + tag: "testtag", + filesCreated: map[string]string{"dir1/branch": "third1", "dir2/branch": "third2"}, + sparseCheckoutDirectories: []string{"dir1", "dir2"}, + expectedCommit: thirdCommit.String(), + expectedNoCloneFiles: []string{"dir3/branch"}, + }, + { + testType: "tag", + name: "Annotated", + annotatedTag: true, + tag: "annotated", + filesCreated: map[string]string{"dir1/branch": "fourth1"}, + sparseCheckoutDirectories: []string{"dir1"}, + expectedCommit: fourthCommit.String(), + expectedNoCloneFiles: []string{"dir2/branch"}, + }, + { + testType: "semver", + name: "Orders by SemVer", + constraint: ">0.1.0", + annotatedTag: true, + filesCreated: map[string]string{"dir1/branch": "semver5"}, + sparseCheckoutDirectories: []string{"dir1"}, + expectedTag: "0.2.0", + expectedCommit: semver5.String(), + expectedNoCloneFiles: []string{"dir2/branch", "dir3/branch"}, + }, + { + testType: "semver", + name: "Orders by SemVer - checkout multiple directories", + constraint: ">0.1.0", + annotatedTag: true, + filesCreated: map[string]string{"dir1/branch": "semver5", "dir2/branch": "semver5"}, + sparseCheckoutDirectories: []string{"dir1", "dir2"}, + expectedTag: "0.2.0", + expectedCommit: semver5.String(), + expectedNoCloneFiles: []string{"dir3/branch"}, + }, + { + testType: "semver", + name: "Orders by SemVer and timestamp", + constraint: "<0.2.0", + annotatedTag: false, + filesCreated: map[string]string{"dir1/branch": "semver4"}, + sparseCheckoutDirectories: []string{"dir1"}, + expectedTag: "v0.1.0+build-3", + expectedCommit: semver4.String(), + expectedNoCloneFiles: []string{"dir2/branch"}, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + g := NewWithT(t) + + tmpDir := t.TempDir() + ggc, err := NewClient(tmpDir, &git.AuthOptions{Transport: git.HTTP}) + g.Expect(err).ToNot(HaveOccurred()) + + var upstreamPath string + if tt.expectedEmpty { + upstreamPath = emptyRepoPath + } else { + upstreamPath = repoPath + } + + cc, err := ggc.Clone(context.TODO(), upstreamPath, repository.CloneConfig{ + CheckoutStrategy: repository.CheckoutStrategy{ + Branch: tt.branch, + Commit: tt.commit, + Tag: tt.tag, + SemVer: tt.constraint, + }, + ShallowClone: true, + LastObservedCommit: tt.lastRevision, + SparseCheckoutDirectories: tt.sparseCheckoutDirectories, + }) + + for _, noCloneFile := range tt.expectedNoCloneFiles { + g.Expect(filepath.Join(tmpDir, noCloneFile)).ToNot(BeAnExistingFile()) + } + + switch tt.testType { + case "branch": + if tt.expectedErr != "" { + g.Expect(err).To(HaveOccurred()) + g.Expect(err.Error()).To(ContainSubstring(tt.expectedErr)) + g.Expect(cc).To(BeNil()) + return + } + + if tt.expectedEmpty { + g.Expect(cc).To(BeNil()) + g.Expect(err).ToNot(HaveOccurred()) + g.Expect(filepath.Join(ggc.path, ".git")).To(BeADirectory()) + return + } + + g.Expect(err).ToNot(HaveOccurred()) + if tt.commit == "" && tt.branch != "" { + g.Expect(cc.String()).To(Equal(tt.branch + "@" + git.HashTypeSHA1 + ":" + tt.expectedCommit)) + g.Expect(git.IsConcreteCommit(*cc)).To(Equal(tt.expectedConcreteCommit)) + } + + if tt.expectedConcreteCommit { + for k, v := range tt.filesCreated { + g.Expect(filepath.Join(tmpDir, k)).To(BeARegularFile()) + g.Expect(os.ReadFile(filepath.Join(tmpDir, k))).To(BeEquivalentTo(v)) + } + } + case "commit": + g.Expect(cc.String()).To(Equal(tt.expectedCommit)) + for k, v := range tt.filesCreated { + g.Expect(filepath.Join(tmpDir, k)).To(BeARegularFile()) + g.Expect(os.ReadFile(filepath.Join(tmpDir, k))).To(BeEquivalentTo(v)) + } + case "tag": + g.Expect(err).ToNot(HaveOccurred()) + g.Expect(cc.String()).To(Equal(tt.tag + "@" + git.HashTypeSHA1 + ":" + tt.expectedCommit)) + + g.Expect(cc.ReferencingTag).ToNot(BeNil()) + if tt.annotatedTag { + g.Expect(git.IsAnnotatedTag(*cc.ReferencingTag)).To(BeTrue()) + g.Expect(cc.ReferencingTag.Message).To(Equal(fmt.Sprintf("Annotated tag for: %s\n", tt.tag))) + } else { + g.Expect(git.IsAnnotatedTag(*cc.ReferencingTag)).To(BeFalse()) + } + for k, v := range tt.filesCreated { + g.Expect(filepath.Join(tmpDir, k)).To(BeARegularFile()) + g.Expect(os.ReadFile(filepath.Join(tmpDir, k))).To(BeEquivalentTo(v)) + } + case "semver": + g.Expect(err).ToNot(HaveOccurred()) + g.Expect(cc.String()).To(Equal(tt.expectedTag + "@" + git.HashTypeSHA1 + ":" + tt.expectedCommit)) + for k, v := range tt.filesCreated { + g.Expect(filepath.Join(tmpDir, k)).To(BeARegularFile()) + g.Expect(os.ReadFile(filepath.Join(tmpDir, k))).To(BeEquivalentTo(v)) + } + g.Expect(cc.ReferencingTag).ToNot(BeNil()) + if tt.annotatedTag { + g.Expect(git.IsAnnotatedTag(*cc.ReferencingTag)).To(BeTrue()) + g.Expect(cc.ReferencingTag.Message).To(Equal(fmt.Sprintf("Annotated tag for: %s\n", tt.expectedTag))) + } else { + g.Expect(git.IsAnnotatedTag(*cc.ReferencingTag)).To(BeFalse()) + } + } + }) + } +} + // Test_ssh_KeyTypes assures support for the different types of keys // for SSH Authentication supported by Flux. func Test_ssh_KeyTypes(t *testing.T) { @@ -1273,7 +1617,6 @@ func Test_getRemoteHEAD(t *testing.T) { } func Test_filterRefs(t *testing.T) { - refStrings := []string{"refs/heads/main", "refs/tags/v1.0.0", "refs/pull/1/head", "refs/tags/v1.1.0", "refs/tags/v1.0.0" + tagDereferenceSuffix} dummyHash := "84d9be20ca15d29bebc629e5b6f29dab78cc69ba" annotatedTagHash := "9000be6daa3323cb7009075259bb7bd62498d32f" @@ -1567,6 +1910,33 @@ func commitFile(repo *extgogit.Repository, path, content string, time time.Time) }) } +func commitFiles(repo *extgogit.Repository, files map[string]string, time time.Time) (plumbing.Hash, error) { + wt, err := repo.Worktree() + if err != nil { + return plumbing.Hash{}, err + } + for path, content := range files { + f, err := wt.Filesystem.Create(path) + if err != nil { + return plumbing.Hash{}, err + } + if _, err = f.Write([]byte(content)); err != nil { + f.Close() + return plumbing.Hash{}, err + } + if err = f.Close(); err != nil { + return plumbing.Hash{}, err + } + if _, err = wt.Add(path); err != nil { + return plumbing.Hash{}, err + } + } + return wt.Commit(fmt.Sprintf("Adding files:\n%s", strings.Join(slices.Collect(maps.Keys(files)), "\n")), &extgogit.CommitOptions{ + Author: mockSignature(time), + Committer: mockSignature(time), + }) +} + func tag(repo *extgogit.Repository, commit plumbing.Hash, annotated bool, tag string, time time.Time) (*plumbing.Reference, error) { var opts *extgogit.CreateTagOptions if annotated { diff --git a/git/gogit/go.mod b/git/gogit/go.mod index c9b4f01c..f28a4dc3 100644 --- a/git/gogit/go.mod +++ b/git/gogit/go.mod @@ -13,15 +13,15 @@ replace ( require ( github.com/Masterminds/semver/v3 v3.3.1 github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 - github.com/elazarl/goproxy v0.0.0-20240909085733-6741dbfc16a1 + github.com/elazarl/goproxy v1.2.3 github.com/fluxcd/gitkit v0.6.0 github.com/fluxcd/pkg/auth v0.2.0 github.com/fluxcd/pkg/git v0.22.0 github.com/fluxcd/pkg/gittestserver v0.15.0 github.com/fluxcd/pkg/ssh v0.16.0 github.com/fluxcd/pkg/version v0.6.0 - github.com/go-git/go-billy/v5 v5.6.0 - github.com/go-git/go-git/v5 v5.12.0 + github.com/go-git/go-billy/v5 v5.6.1 + github.com/go-git/go-git/v5 v5.13.1 github.com/onsi/gomega v1.36.1 golang.org/x/crypto v0.31.0 ) @@ -36,7 +36,7 @@ require ( github.com/ProtonMail/go-crypto v1.1.3 // indirect github.com/bradleyfalzon/ghinstallation/v2 v2.12.0 // indirect github.com/cloudflare/circl v1.5.0 // indirect - github.com/cyphar/filepath-securejoin v0.3.5 // indirect + github.com/cyphar/filepath-securejoin v0.3.6 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/gofrs/uuid v4.4.0+incompatible // indirect @@ -56,7 +56,7 @@ require ( github.com/skeema/knownhosts v1.3.0 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect golang.org/x/mod v0.22.0 // indirect - golang.org/x/net v0.32.0 // indirect + golang.org/x/net v0.33.0 // indirect golang.org/x/sync v0.10.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect diff --git a/git/gogit/go.sum b/git/gogit/go.sum index 55ef9314..9b7a6fc5 100644 --- a/git/gogit/go.sum +++ b/git/gogit/go.sum @@ -29,32 +29,30 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cloudflare/circl v1.5.0 h1:hxIWksrX6XN5a1L2TI/h53AGPhNHoUBo+TD1ms9+pys= github.com/cloudflare/circl v1.5.0/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= -github.com/cyphar/filepath-securejoin v0.3.5 h1:L81NHjquoQmcPgXcttUS9qTSR/+bXry6pbSINQGpjj4= -github.com/cyphar/filepath-securejoin v0.3.5/go.mod h1:edhVd3c6OXKjUmSrVa/tGJRS9joFTxlslFCAyaxigkE= +github.com/cyphar/filepath-securejoin v0.3.6 h1:4d9N5ykBnSp5Xn2JkhocYDkOpURL/18CYMpo6xB9uWM= +github.com/cyphar/filepath-securejoin v0.3.6/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/elazarl/goproxy v0.0.0-20240909085733-6741dbfc16a1 h1:g7YUigN4dW2+zpdusdTTghZ+5Py3BaUMAStvL8Nk+FY= -github.com/elazarl/goproxy v0.0.0-20240909085733-6741dbfc16a1/go.mod h1:thX175TtLTzLj3p7N/Q9IiKZ7NF+p72cvL91emV0hzo= -github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2 h1:dWB6v3RcOy03t/bUadywsbyrQwCqZeNIEX6M1OtSZOM= -github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8= +github.com/elazarl/goproxy v1.2.3 h1:xwIyKHbaP5yfT6O9KIeYJR5549MXRQkoQMRXGztz8YQ= +github.com/elazarl/goproxy v1.2.3/go.mod h1:YfEbZtqP4AetfO6d40vWchF3znWX7C7Vd6ZMfdL8z64= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/fluxcd/gitkit v0.6.0 h1:iNg5LTx6ePo+Pl0ZwqHTAkhbUHxGVSY3YCxCdw7VIFg= github.com/fluxcd/gitkit v0.6.0/go.mod h1:svOHuKi0fO9HoawdK4HfHAJJseZDHHjk7I3ihnCIqNo= -github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE= -github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= +github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c= +github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= -github.com/go-git/go-billy/v5 v5.6.0 h1:w2hPNtoehvJIxR00Vb4xX94qHQi/ApZfX+nBE2Cjio8= -github.com/go-git/go-billy/v5 v5.6.0/go.mod h1:sFDq7xD3fn3E0GOwUSZqHo9lrkmx8xJhA0ZrfvjBRGM= +github.com/go-git/go-billy/v5 v5.6.1 h1:u+dcrgaguSSkbjzHwelEjc0Yj300NUevrrPphk/SoRA= +github.com/go-git/go-billy/v5 v5.6.1/go.mod h1:0AsLr1z2+Uksi4NlElmMblP5rPcDZNRCD8ujZCRR2BE= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= -github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= +github.com/go-git/go-git/v5 v5.13.1 h1:DAQ9APonnlvSWpvolXWIuV6Q6zXy2wHbN4cVlNR5Q+M= +github.com/go-git/go-git/v5 v5.13.1/go.mod h1:qryJB4cSBoq3FRoBRf5A77joojuBcmPJ0qu3XXXVixc= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= @@ -118,8 +116,8 @@ github.com/skeema/knownhosts v1.3.0/go.mod h1:sPINvnADmT/qYH1kfv+ePMmOBTH6Tbl7b5 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= @@ -128,8 +126,8 @@ golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ss golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= -golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/git/internal/e2e/go.mod b/git/internal/e2e/go.mod index 8c35248b..f2c80e39 100644 --- a/git/internal/e2e/go.mod +++ b/git/internal/e2e/go.mod @@ -18,7 +18,7 @@ require ( github.com/fluxcd/pkg/git/gogit v0.22.0 github.com/fluxcd/pkg/gittestserver v0.15.0 github.com/fluxcd/pkg/ssh v0.16.0 - github.com/go-git/go-git/v5 v5.12.0 + github.com/go-git/go-git/v5 v5.13.1 github.com/go-logr/logr v1.4.2 github.com/google/go-github/v66 v66.0.0 github.com/google/uuid v1.6.0 @@ -36,13 +36,13 @@ require ( github.com/ProtonMail/go-crypto v1.1.3 // indirect github.com/bradleyfalzon/ghinstallation/v2 v2.12.0 // indirect github.com/cloudflare/circl v1.5.0 // indirect - github.com/cyphar/filepath-securejoin v0.3.5 // indirect + github.com/cyphar/filepath-securejoin v0.3.6 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/fluxcd/gitkit v0.6.0 // indirect github.com/fluxcd/pkg/version v0.6.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect - github.com/go-git/go-billy/v5 v5.6.0 // indirect + github.com/go-git/go-billy/v5 v5.6.1 // indirect github.com/gofrs/uuid v4.4.0+incompatible // indirect github.com/golang-jwt/jwt/v4 v4.5.1 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect @@ -65,7 +65,7 @@ require ( github.com/xanzy/ssh-agent v0.3.3 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.31.0 // indirect - golang.org/x/net v0.32.0 // indirect + golang.org/x/net v0.33.0 // indirect golang.org/x/oauth2 v0.24.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect diff --git a/git/internal/e2e/go.sum b/git/internal/e2e/go.sum index 4a04c658..03d448e5 100644 --- a/git/internal/e2e/go.sum +++ b/git/internal/e2e/go.sum @@ -29,16 +29,16 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cloudflare/circl v1.5.0 h1:hxIWksrX6XN5a1L2TI/h53AGPhNHoUBo+TD1ms9+pys= github.com/cloudflare/circl v1.5.0/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= -github.com/cyphar/filepath-securejoin v0.3.5 h1:L81NHjquoQmcPgXcttUS9qTSR/+bXry6pbSINQGpjj4= -github.com/cyphar/filepath-securejoin v0.3.5/go.mod h1:edhVd3c6OXKjUmSrVa/tGJRS9joFTxlslFCAyaxigkE= +github.com/cyphar/filepath-securejoin v0.3.6 h1:4d9N5ykBnSp5Xn2JkhocYDkOpURL/18CYMpo6xB9uWM= +github.com/cyphar/filepath-securejoin v0.3.6/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/elazarl/goproxy v0.0.0-20240909085733-6741dbfc16a1 h1:g7YUigN4dW2+zpdusdTTghZ+5Py3BaUMAStvL8Nk+FY= -github.com/elazarl/goproxy v0.0.0-20240909085733-6741dbfc16a1/go.mod h1:thX175TtLTzLj3p7N/Q9IiKZ7NF+p72cvL91emV0hzo= +github.com/elazarl/goproxy v1.2.3 h1:xwIyKHbaP5yfT6O9KIeYJR5549MXRQkoQMRXGztz8YQ= +github.com/elazarl/goproxy v1.2.3/go.mod h1:YfEbZtqP4AetfO6d40vWchF3znWX7C7Vd6ZMfdL8z64= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= @@ -49,16 +49,16 @@ github.com/fluxcd/go-git-providers v0.22.0 h1:THHUcCZkFQBWE5FlipRJMpUwA9v/Vj+tf9 github.com/fluxcd/go-git-providers v0.22.0/go.mod h1:qkdWXdcA/9ILOkesIXB1rDtcvi3h1FgnmbCn84yYpTk= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE= -github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= +github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c= +github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= -github.com/go-git/go-billy/v5 v5.6.0 h1:w2hPNtoehvJIxR00Vb4xX94qHQi/ApZfX+nBE2Cjio8= -github.com/go-git/go-billy/v5 v5.6.0/go.mod h1:sFDq7xD3fn3E0GOwUSZqHo9lrkmx8xJhA0ZrfvjBRGM= +github.com/go-git/go-billy/v5 v5.6.1 h1:u+dcrgaguSSkbjzHwelEjc0Yj300NUevrrPphk/SoRA= +github.com/go-git/go-billy/v5 v5.6.1/go.mod h1:0AsLr1z2+Uksi4NlElmMblP5rPcDZNRCD8ujZCRR2BE= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= -github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= +github.com/go-git/go-git/v5 v5.13.1 h1:DAQ9APonnlvSWpvolXWIuV6Q6zXy2wHbN4cVlNR5Q+M= +github.com/go-git/go-git/v5 v5.13.1/go.mod h1:qryJB4cSBoq3FRoBRf5A77joojuBcmPJ0qu3XXXVixc= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= @@ -145,8 +145,8 @@ github.com/skeema/knownhosts v1.3.0/go.mod h1:sPINvnADmT/qYH1kfv+ePMmOBTH6Tbl7b5 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/xanzy/go-gitlab v0.114.0 h1:0wQr/KBckwrZPfEMjRqpUz0HmsKKON9UhCYv9KDy19M= github.com/xanzy/go-gitlab v0.114.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= @@ -159,8 +159,8 @@ golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= -golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/git/repository/options.go b/git/repository/options.go index b82dba83..e2abd937 100644 --- a/git/repository/options.go +++ b/git/repository/options.go @@ -51,6 +51,10 @@ type CloneConfig struct { // ShallowClone defines if the repository should be shallow cloned, // not supported by all implementations ShallowClone bool + + // SparseCheckoutDirectories defines a list of directories to sparse-checkout + // when cloning the repository. If provided, only listed directories are checked out. + SparseCheckoutDirectories []string } // PushConfig provides configuration options for a Git push. diff --git a/oci/tests/integration/go.mod b/oci/tests/integration/go.mod index 6ca6e686..ef9476bc 100644 --- a/oci/tests/integration/go.mod +++ b/oci/tests/integration/go.mod @@ -15,7 +15,7 @@ require ( github.com/fluxcd/pkg/git/gogit v0.21.0 github.com/fluxcd/pkg/oci v0.41.1 github.com/fluxcd/test-infra/tftestenv v0.0.0-20240903092121-c783b14801d1 - github.com/go-git/go-git/v5 v5.12.0 + github.com/go-git/go-git/v5 v5.13.1 github.com/google/go-containerregistry v0.20.2 github.com/google/uuid v1.6.0 github.com/hashicorp/terraform-exec v0.21.0 @@ -56,7 +56,7 @@ require ( github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudflare/circl v1.5.0 // indirect github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect - github.com/cyphar/filepath-securejoin v0.3.5 // indirect + github.com/cyphar/filepath-securejoin v0.3.6 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/docker/cli v27.1.2+incompatible // indirect github.com/docker/distribution v2.8.3+incompatible // indirect @@ -69,7 +69,7 @@ require ( github.com/fluxcd/pkg/version v0.6.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect - github.com/go-git/go-billy/v5 v5.6.0 // indirect + github.com/go-git/go-billy/v5 v5.6.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/zapr v1.3.0 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect @@ -124,7 +124,7 @@ require ( golang.org/x/crypto v0.31.0 // indirect golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect golang.org/x/mod v0.22.0 // indirect - golang.org/x/net v0.32.0 // indirect + golang.org/x/net v0.33.0 // indirect golang.org/x/oauth2 v0.24.0 // indirect golang.org/x/sync v0.10.0 // indirect golang.org/x/sys v0.28.0 // indirect diff --git a/oci/tests/integration/go.sum b/oci/tests/integration/go.sum index 737cc219..6f34c7e3 100644 --- a/oci/tests/integration/go.sum +++ b/oci/tests/integration/go.sum @@ -66,8 +66,8 @@ github.com/containerd/stargz-snapshotter/estargz v0.14.3 h1:OqlDCK3ZVUO6C3B/5FSk github.com/containerd/stargz-snapshotter/estargz v0.14.3/go.mod h1:KY//uOCIkSuNAHhJogcZtrNHdKrA99/FCCRjE3HD36o= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyphar/filepath-securejoin v0.3.5 h1:L81NHjquoQmcPgXcttUS9qTSR/+bXry6pbSINQGpjj4= -github.com/cyphar/filepath-securejoin v0.3.5/go.mod h1:edhVd3c6OXKjUmSrVa/tGJRS9joFTxlslFCAyaxigkE= +github.com/cyphar/filepath-securejoin v0.3.6 h1:4d9N5ykBnSp5Xn2JkhocYDkOpURL/18CYMpo6xB9uWM= +github.com/cyphar/filepath-securejoin v0.3.6/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -80,8 +80,8 @@ github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBi github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo= github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M= -github.com/elazarl/goproxy v0.0.0-20240909085733-6741dbfc16a1 h1:g7YUigN4dW2+zpdusdTTghZ+5Py3BaUMAStvL8Nk+FY= -github.com/elazarl/goproxy v0.0.0-20240909085733-6741dbfc16a1/go.mod h1:thX175TtLTzLj3p7N/Q9IiKZ7NF+p72cvL91emV0hzo= +github.com/elazarl/goproxy v1.2.3 h1:xwIyKHbaP5yfT6O9KIeYJR5549MXRQkoQMRXGztz8YQ= +github.com/elazarl/goproxy v1.2.3/go.mod h1:YfEbZtqP4AetfO6d40vWchF3znWX7C7Vd6ZMfdL8z64= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= @@ -102,16 +102,16 @@ github.com/fluxcd/test-infra/tftestenv v0.0.0-20240903092121-c783b14801d1 h1:zrw github.com/fluxcd/test-infra/tftestenv v0.0.0-20240903092121-c783b14801d1/go.mod h1:liFlLEXgambGVdWSJ4JzbIHf1Vjpp1HwUyPazPIVZug= github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= -github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE= -github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= +github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c= +github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= -github.com/go-git/go-billy/v5 v5.6.0 h1:w2hPNtoehvJIxR00Vb4xX94qHQi/ApZfX+nBE2Cjio8= -github.com/go-git/go-billy/v5 v5.6.0/go.mod h1:sFDq7xD3fn3E0GOwUSZqHo9lrkmx8xJhA0ZrfvjBRGM= +github.com/go-git/go-billy/v5 v5.6.1 h1:u+dcrgaguSSkbjzHwelEjc0Yj300NUevrrPphk/SoRA= +github.com/go-git/go-billy/v5 v5.6.1/go.mod h1:0AsLr1z2+Uksi4NlElmMblP5rPcDZNRCD8ujZCRR2BE= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= -github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= +github.com/go-git/go-git/v5 v5.13.1 h1:DAQ9APonnlvSWpvolXWIuV6Q6zXy2wHbN4cVlNR5Q+M= +github.com/go-git/go-git/v5 v5.13.1/go.mod h1:qryJB4cSBoq3FRoBRf5A77joojuBcmPJ0qu3XXXVixc= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= @@ -299,8 +299,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= -golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=