MCPcopy Index your code
hub / github.com/kopia/kopia / shouldInclude

Method shouldInclude

cli/command_blob_list.go:59–93  ·  view source on GitHub ↗
(b blob.Metadata)

Source from the content-addressed store, hash-verified

57}
58
59func (c *commandBlobList) shouldInclude(b blob.Metadata) bool {
60 if c.dataOnly {
61 if strings.HasPrefix(string(b.BlobID), indexblob.V0IndexBlobPrefix) {
62 return false
63 }
64
65 if strings.HasPrefix(string(b.BlobID), epoch.EpochManagerIndexUberPrefix) {
66 return false
67 }
68
69 if strings.HasPrefix(string(b.BlobID), repodiag.LogBlobPrefix) {
70 return false
71 }
72
73 if strings.HasPrefix(string(b.BlobID), "kopia.") {
74 return false
75 }
76 }
77
78 if c.blobListMaxSize != 0 && b.Length > c.blobListMaxSize {
79 return false
80 }
81
82 if c.blobListMinSize != 0 && b.Length < c.blobListMinSize {
83 return false
84 }
85
86 for _, ex := range c.blobListPrefixExclude {
87 if strings.HasPrefix(string(b.BlobID), ex) {
88 return false
89 }
90 }
91
92 return true
93}

Callers 1

runMethod · 0.95

Calls 1

HasPrefixMethod · 0.80

Tested by

no test coverage detected