本站源代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
415B

  1. package filesystem
  2. import (
  3. "gopkg.in/src-d/go-git.v4/plumbing/cache"
  4. "gopkg.in/src-d/go-git.v4/storage"
  5. "gopkg.in/src-d/go-git.v4/storage/filesystem/dotgit"
  6. )
  7. type ModuleStorage struct {
  8. dir *dotgit.DotGit
  9. }
  10. func (s *ModuleStorage) Module(name string) (storage.Storer, error) {
  11. fs, err := s.dir.Module(name)
  12. if err != nil {
  13. return nil, err
  14. }
  15. return NewStorage(fs, cache.NewObjectLRUDefault()), nil
  16. }
上海开阖软件有限公司 沪ICP备12045867号-1