(t *testing.T, g *TestGitRepo)
| 328 | } |
| 329 | |
| 330 | func 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 |
| 349 | func (g *TestGitRepo) ReplaceData(data string) error { |
no test coverage detected