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

Method TestCheckoutForce

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

Source from the content-addressed store, hash-verified

382}
383
384func (s *WorktreeSuite) TestCheckoutForce(c *C) {
385 w := &Worktree{
386 r: s.Repository,
387 Filesystem: memfs.New(),
388 }
389
390 err := w.Checkout(&CheckoutOptions{})
391 c.Assert(err, IsNil)
392
393 w.Filesystem = memfs.New()
394
395 err = w.Checkout(&CheckoutOptions{
396 Force: true,
397 })
398 c.Assert(err, IsNil)
399
400 entries, err := w.Filesystem.ReadDir("/")
401 c.Assert(err, IsNil)
402 c.Assert(entries, HasLen, 8)
403}
404
405func (s *WorktreeSuite) TestCheckoutKeep(c *C) {
406 w := &Worktree{

Callers

nothing calls this directly

Calls 2

CheckoutMethod · 0.95
ReadDirMethod · 0.45

Tested by

no test coverage detected