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

Method TestMoveToExistent

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

Source from the content-addressed store, hash-verified

2306}
2307
2308func (s *WorktreeSuite) TestMoveToExistent(c *C) {
2309 fs := memfs.New()
2310 w := &Worktree{
2311 r: s.Repository,
2312 Filesystem: fs,
2313 }
2314
2315 err := w.Checkout(&CheckoutOptions{Force: true})
2316 c.Assert(err, IsNil)
2317
2318 hash, err := w.Move(".gitignore", "LICENSE")
2319 c.Assert(hash.IsZero(), Equals, true)
2320 c.Assert(err, Equals, ErrDestinationExists)
2321}
2322
2323func (s *WorktreeSuite) TestClean(c *C) {
2324 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