MCPcopy Create free account
hub / github.com/go-git/go-git / TestCheckoutCreateInvalidBranch

Method TestCheckoutCreateInvalidBranch

worktree_test.go:828–850  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

826}
827
828func (s *WorktreeSuite) TestCheckoutCreateInvalidBranch(c *C) {
829 w := &Worktree{
830 r: s.Repository,
831 Filesystem: memfs.New(),
832 }
833
834 for _, name := range []plumbing.ReferenceName{
835 "foo",
836 "-",
837 "-foo",
838 "refs/heads//",
839 "refs/heads/..",
840 "refs/heads/a..b",
841 "refs/heads/.",
842 } {
843 err := w.Checkout(&CheckoutOptions{
844 Create: true,
845 Branch: name,
846 })
847
848 c.Assert(err, Equals, plumbing.ErrInvalidReferenceName)
849 }
850}
851
852func (s *WorktreeSuite) TestCheckoutTag(c *C) {
853 f := fixtures.ByTag("tags").One()

Callers

nothing calls this directly

Calls 1

CheckoutMethod · 0.95

Tested by

no test coverage detected