Skip to content

Commit

Permalink
Merge pull request #650 from pjbgf/upstream-billy
Browse files Browse the repository at this point in the history
git/gogit: Replaces `fs` with upstream `osfs.BoundOS`
  • Loading branch information
Paulo Gomes authored Sep 13, 2023
2 parents 01981ea + e8ee260 commit 6eae7b4
Show file tree
Hide file tree
Showing 12 changed files with 81 additions and 2,163 deletions.
6 changes: 3 additions & 3 deletions git/gogit/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (

"github.com/go-git/go-billy/v5"
"github.com/go-git/go-billy/v5/memfs"
"github.com/go-git/go-billy/v5/osfs"
extgogit "github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/config"
"github.com/go-git/go-git/v5/plumbing"
Expand All @@ -39,7 +40,6 @@ import (
"github.com/go-git/go-git/v5/storage/memory"

"github.com/fluxcd/pkg/git"
"github.com/fluxcd/pkg/git/gogit/fs"
"github.com/fluxcd/pkg/git/repository"
)

Expand Down Expand Up @@ -159,8 +159,8 @@ func WithSingleBranch(singleBranch bool) ClientOption {
// Git related objects on disk.
func WithDiskStorage() ClientOption {
return func(c *Client) error {
wt := fs.New(c.path)
dot := fs.New(filepath.Join(c.path, extgogit.GitDirName))
wt := osfs.New(c.path, osfs.WithBoundOS())
dot := osfs.New(filepath.Join(c.path, extgogit.GitDirName), osfs.WithBoundOS())

c.storer = filesystem.NewStorage(dot, cache.NewObjectLRUDefault())
c.worktreeFS = wt
Expand Down
4 changes: 2 additions & 2 deletions git/gogit/clone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (

"github.com/elazarl/goproxy"
"github.com/go-git/go-billy/v5/memfs"
"github.com/go-git/go-billy/v5/osfs"
extgogit "github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/config"
"github.com/go-git/go-git/v5/plumbing"
Expand All @@ -46,7 +47,6 @@ import (

"github.com/fluxcd/gitkit"
"github.com/fluxcd/pkg/git"
"github.com/fluxcd/pkg/git/gogit/fs"
"github.com/fluxcd/pkg/git/repository"
"github.com/fluxcd/pkg/gittestserver"
"github.com/fluxcd/pkg/ssh"
Expand Down Expand Up @@ -1556,7 +1556,7 @@ func Fuzz_GoGitError(f *testing.F) {
}

func initRepo(tmpDir string) (*extgogit.Repository, string, error) {
sto := filesystem.NewStorage(fs.New(tmpDir), cache.NewObjectLRUDefault())
sto := filesystem.NewStorage(osfs.New(tmpDir, osfs.WithBoundOS()), cache.NewObjectLRUDefault())
repo, err := extgogit.Init(sto, memfs.New())
if err != nil {
return nil, "", err
Expand Down
155 changes: 0 additions & 155 deletions git/gogit/fs/join.go

This file was deleted.

Loading

0 comments on commit 6eae7b4

Please sign in to comment.