Skip to content

Commit

Permalink
remove log
Browse files Browse the repository at this point in the history
Signed-off-by: Somtochi Onyekwere <[email protected]>
  • Loading branch information
somtochiama committed Aug 15, 2022
1 parent 71cbd21 commit d26e2ae
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
20 changes: 0 additions & 20 deletions oci/client/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import (
"strings"
"time"

"github.com/go-git/go-git/v5/plumbing/format/gitignore"

"github.com/fluxcd/pkg/oci/client/internal/fs"
"github.com/fluxcd/pkg/oci/sourceignore"
)
Expand Down Expand Up @@ -155,21 +153,3 @@ func (wc *writeCounter) Write(p []byte) (int, error) {
wc.written += int64(n)
return n, nil
}

// ArchiveFileFilter must return true if a file should not be included in the archive after inspecting the given path
// and/or os.FileInfo.
type ArchiveFileFilter func(p string, fi os.FileInfo) bool

// SourceIgnoreFilter returns an ArchiveFileFilter that filters out files matching sourceignore.VCSPatterns and any of
// the provided patterns.
// If an empty gitignore.Pattern slice is given, the matcher is set to sourceignore.NewDefaultMatcher.
func SourceIgnoreFilter(ps []gitignore.Pattern, domain []string) ArchiveFileFilter {
matcher := sourceignore.NewDefaultMatcher(ps, domain)
if len(ps) > 0 {
ps = append(sourceignore.VCSPatterns(domain), ps...)
matcher = sourceignore.NewMatcher(ps)
}
return func(p string, fi os.FileInfo) bool {
return matcher.Match(strings.Split(p, string(filepath.Separator)), fi.IsDir())
}
}
2 changes: 0 additions & 2 deletions oci/client/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package client

import (
"bytes"
"fmt"
"github.com/fluxcd/pkg/untar"
. "github.com/onsi/gomega"
"os"
Expand Down Expand Up @@ -61,7 +60,6 @@ func TestBuild(t *testing.T) {
}

fullPath := filepath.Join(untarDir, testDir, path)
fmt.Println(fullPath)
_, err := os.Stat(fullPath)
if shouldExist {
g.Expect(err).To(BeNil())
Expand Down

0 comments on commit d26e2ae

Please sign in to comment.