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

Method TestCheckoutBranchAndHash

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

Source from the content-addressed store, hash-verified

886}
887
888func (s *WorktreeSuite) TestCheckoutBranchAndHash(c *C) {
889 w := &Worktree{
890 r: s.Repository,
891 Filesystem: memfs.New(),
892 }
893
894 err := w.Checkout(&CheckoutOptions{
895 Branch: "refs/heads/foo",
896 Hash: plumbing.NewHash("35e85108805c84807bc66a02d91535e1e24b38b9"),
897 })
898
899 c.Assert(err, Equals, ErrBranchHashExclusive)
900}
901
902func (s *WorktreeSuite) TestCheckoutCreateMissingBranch(c *C) {
903 w := &Worktree{

Callers

nothing calls this directly

Calls 2

CheckoutMethod · 0.95
NewHashFunction · 0.92

Tested by

no test coverage detected