MCPcopy Index your code
hub / github.com/go-git/go-git / TestMoveToExistent

Method TestMoveToExistent

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

Source from the content-addressed store, hash-verified

2563}
2564
2565func (s *WorktreeSuite) TestMoveToExistent(c *C) {
2566 fs := memfs.New()
2567 w := &Worktree{
2568 r: s.Repository,
2569 Filesystem: fs,
2570 }
2571
2572 err := w.Checkout(&CheckoutOptions{Force: true})
2573 c.Assert(err, IsNil)
2574
2575 hash, err := w.Move(".gitignore", "LICENSE")
2576 c.Assert(hash.IsZero(), Equals, true)
2577 c.Assert(err, Equals, ErrDestinationExists)
2578}
2579
2580func (s *WorktreeSuite) TestClean(c *C) {
2581 fs := fixtures.ByTag("dirty").One().Worktree()

Callers

nothing calls this directly

Calls 3

CheckoutMethod · 0.95
MoveMethod · 0.95
IsZeroMethod · 0.65

Tested by

no test coverage detected