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

Method TestCheckoutCreateInvalidBranch

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

Source from the content-addressed store, hash-verified

913}
914
915func (s *WorktreeSuite) TestCheckoutCreateInvalidBranch(c *C) {
916 w := &Worktree{
917 r: s.Repository,
918 Filesystem: memfs.New(),
919 }
920
921 for _, name := range []plumbing.ReferenceName{
922 "foo",
923 "-",
924 "-foo",
925 "refs/heads//",
926 "refs/heads/..",
927 "refs/heads/a..b",
928 "refs/heads/.",
929 } {
930 err := w.Checkout(&CheckoutOptions{
931 Create: true,
932 Branch: name,
933 })
934
935 c.Assert(err, Equals, plumbing.ErrInvalidReferenceName)
936 }
937}
938
939func (s *WorktreeSuite) TestCheckoutTag(c *C) {
940 f := fixtures.ByTag("tags").One()

Callers

nothing calls this directly

Calls 1

CheckoutMethod · 0.95

Tested by

no test coverage detected