(c *C)
| 850 | } |
| 851 | |
| 852 | func (s *RepositorySuite) TestPlainOpenDetectDotGit(c *C) { |
| 853 | fs := s.TemporalFilesystem(c) |
| 854 | |
| 855 | dir, err := util.TempDir(fs, "", "") |
| 856 | c.Assert(err, IsNil) |
| 857 | |
| 858 | subdir := filepath.Join(dir, "a", "b") |
| 859 | err = fs.MkdirAll(subdir, 0755) |
| 860 | c.Assert(err, IsNil) |
| 861 | |
| 862 | file := fs.Join(subdir, "file.txt") |
| 863 | f, err := fs.Create(file) |
| 864 | c.Assert(err, IsNil) |
| 865 | f.Close() |
| 866 | |
| 867 | r, err := PlainInit(fs.Join(fs.Root(), dir), false) |
| 868 | c.Assert(err, IsNil) |
| 869 | c.Assert(r, NotNil) |
| 870 | |
| 871 | opt := &PlainOpenOptions{DetectDotGit: true} |
| 872 | r, err = PlainOpenWithOptions(fs.Join(fs.Root(), subdir), opt) |
| 873 | c.Assert(err, IsNil) |
| 874 | c.Assert(r, NotNil) |
| 875 | |
| 876 | r, err = PlainOpenWithOptions(fs.Join(fs.Root(), file), opt) |
| 877 | c.Assert(err, IsNil) |
| 878 | c.Assert(r, NotNil) |
| 879 | |
| 880 | optnodetect := &PlainOpenOptions{DetectDotGit: false} |
| 881 | r, err = PlainOpenWithOptions(fs.Join(fs.Root(), file), optnodetect) |
| 882 | c.Assert(err, NotNil) |
| 883 | c.Assert(r, IsNil) |
| 884 | } |
| 885 | |
| 886 | func (s *RepositorySuite) TestPlainOpenNotExistsDetectDotGit(c *C) { |
| 887 | dir := c.MkDir() |
nothing calls this directly
no test coverage detected