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

Method TestAddUnmodified

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

Source from the content-addressed store, hash-verified

1556}
1557
1558func (s *WorktreeSuite) TestAddUnmodified(c *C) {
1559 fs := memfs.New()
1560 w := &Worktree{
1561 r: s.Repository,
1562 Filesystem: fs,
1563 }
1564
1565 err := w.Checkout(&CheckoutOptions{Force: true})
1566 c.Assert(err, IsNil)
1567
1568 hash, err := w.Add("LICENSE")
1569 c.Assert(hash.String(), Equals, "c192bd6a24ea1ab01d78686e417c8bdc7c3d197f")
1570 c.Assert(err, IsNil)
1571}
1572
1573func (s *WorktreeSuite) TestAddRemoved(c *C) {
1574 fs := memfs.New()

Callers

nothing calls this directly

Calls 3

CheckoutMethod · 0.95
AddMethod · 0.95
StringMethod · 0.65

Tested by

no test coverage detected