MCPcopy
hub / github.com/kptdev/kpt / RemoveData

Function RemoveData

internal/testutil/testutil.go:330–346  ·  view source on GitHub ↗
(t *testing.T, g *TestGitRepo)

Source from the content-addressed store, hash-verified

328}
329
330func RemoveData(t *testing.T, g *TestGitRepo) {
331 // remove the old data
332 files, err := ioutil.ReadDir(g.RepoDirectory)
333 if err != nil {
334 t.FailNow()
335 }
336 for i := range files {
337 f := files[i]
338 if f.IsDir() && f.Name() == ".git" {
339 continue
340 }
341 err := os.RemoveAll(filepath.Join(g.RepoDirectory, f.Name()))
342 if err != nil {
343 t.FailNow()
344 }
345 }
346}
347
348// ReplaceData replaces the data with a new source
349func (g *TestGitRepo) ReplaceData(data string) error {

Callers 1

SetupGitRepoFunction · 0.92

Calls 2

NameMethod · 0.80
RemoveAllMethod · 0.45

Tested by

no test coverage detected