NewRepositoryWithEmptyWorktree returns a new repository using the .git folder from the fixture but without a empty memfs worktree, the index and the modules are deleted from the .git folder.
(f *fixtures.Fixture)
| 75 | // from the fixture but without a empty memfs worktree, the index and the |
| 76 | // modules are deleted from the .git folder. |
| 77 | func (s *BaseSuite) NewRepositoryWithEmptyWorktree(f *fixtures.Fixture) *Repository { |
| 78 | dotgit := f.DotGit() |
| 79 | err := dotgit.Remove("index") |
| 80 | if err != nil { |
| 81 | panic(err) |
| 82 | } |
| 83 | |
| 84 | err = util.RemoveAll(dotgit, "modules") |
| 85 | if err != nil { |
| 86 | panic(err) |
| 87 | } |
| 88 | |
| 89 | worktree := memfs.New() |
| 90 | |
| 91 | st := filesystem.NewStorage(dotgit, cache.NewObjectLRUDefault()) |
| 92 | |
| 93 | r, err := Open(st, worktree) |
| 94 | if err != nil { |
| 95 | panic(err) |
| 96 | } |
| 97 | |
| 98 | return r |
| 99 | |
| 100 | } |
| 101 | |
| 102 | func (s *BaseSuite) NewRepositoryFromPackfile(f *fixtures.Fixture) *Repository { |
| 103 | h := f.PackfileHash |
no test coverage detected