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

Method SetLocalData

internal/testutil/setup_manager.go:242–256  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

240}
241
242func (g *TestSetupManager) SetLocalData(path string) bool {
243 if !assert.NoError(g.T, copyutil.CopyDir(
244 filepath.Join(g.UpstreamRepo.DatasetDirectory, path),
245 filepath.Join(g.LocalWorkspace.WorkspaceDirectory, g.UpstreamRepo.RepoName))) {
246 return false
247 }
248 localGit := gitutil.NewLocalGitRunner(g.LocalWorkspace.WorkspaceDirectory)
249 if !assert.NoError(g.T, localGit.Run("add", ".")) {
250 return false
251 }
252 if !assert.NoError(g.T, localGit.Run("commit", "-m", "add files")) {
253 return false
254 }
255 return true
256}
257
258func (g *TestSetupManager) Clean() {
259 g.cleanTestRepo()

Callers 1

Calls 2

NewLocalGitRunnerFunction · 0.92
RunMethod · 0.45

Tested by 1