MCPcopy
hub / github.com/go-git/go-git / TestPlainOpenTildePath

Method TestPlainOpenTildePath

repository_test.go:698–719  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

696}
697
698func (s *RepositorySuite) TestPlainOpenTildePath(c *C) {
699 dir, clean := s.TemporalHomeDir()
700 defer clean()
701
702 r, err := PlainInit(dir, false)
703 c.Assert(err, IsNil)
704 c.Assert(r, NotNil)
705
706 currentUser, err := user.Current()
707 c.Assert(err, IsNil)
708 // remove domain for windows
709 username := currentUser.Username[strings.Index(currentUser.Username, "\\")+1:]
710
711 homes := []string{"~/", "~" + username + "/"}
712 for _, home := range homes {
713 path := strings.Replace(dir, strings.Split(dir, ".tmp")[0], home, 1)
714
715 r, err = PlainOpen(path)
716 c.Assert(err, IsNil)
717 c.Assert(r, NotNil)
718 }
719}
720
721func (s *RepositorySuite) TestPlainOpenBare(c *C) {
722 dir := c.MkDir()

Callers

nothing calls this directly

Calls 4

PlainInitFunction · 0.85
PlainOpenFunction · 0.85
TemporalHomeDirMethod · 0.80
IndexMethod · 0.65

Tested by

no test coverage detected