Skip to content

Commit

Permalink
change clone opts fs
Browse files Browse the repository at this point in the history
  • Loading branch information
roi-codefresh committed Jun 8, 2021
1 parent cd2306a commit 5ba8ae6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/commands/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func setAppOptsDefaults(ctx context.Context, repofs fs.FS, opts *AppCreateOption
cloneOpts := &git.CloneOptions{
Repo: opts.AppOpts.AppSpecifier,
Auth: opts.CloneOpts.Auth,
FS: memfs.New(),
FS: fs.Create(memfs.New()),
}
cloneOpts.Parse()
_, fsys, err = clone(ctx, cloneOpts)
Expand Down
2 changes: 1 addition & 1 deletion cmd/commands/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func RunRepoCreate(ctx context.Context, opts *RepoCreateOptions) (*git.CloneOpti

co := &git.CloneOptions{
Repo: repoUrl,
FS: memfs.New(),
FS: fs.Create(memfs.New()),
Auth: git.Auth{
Password: opts.Token,
},
Expand Down
6 changes: 3 additions & 3 deletions pkg/git/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type (
// URL clone url
Repo string
Auth Auth
FS billy.Filesystem
FS fs.FS
Progress io.Writer
url string
revision string
Expand Down Expand Up @@ -79,9 +79,9 @@ var (
}
)

func AddFlags(cmd *cobra.Command, fs billy.Filesystem, prefix string) *CloneOptions {
func AddFlags(cmd *cobra.Command, bfs billy.Filesystem, prefix string) *CloneOptions {
co := &CloneOptions{
FS: fs,
FS: fs.Create(bfs),
}

if prefix == "" {
Expand Down
2 changes: 1 addition & 1 deletion pkg/git/repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ func TestClone(t *testing.T) {

if tt.opts != nil {
tt.opts.Parse()
tt.opts.FS = memfs.New()
tt.opts.FS = fs.Create(memfs.New())
}

gotRepo, gotFS, err := tt.opts.Clone(context.Background())
Expand Down

0 comments on commit 5ba8ae6

Please sign in to comment.