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

Method TestCheckoutForce

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

CheckoutMethod · 0.95
ReadDirMethod · 0.45

Tested by

no test coverage detected