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

Method TestAddUnmodified

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

Source from the content-addressed store, hash-verified

1756}
1757
1758func (s *WorktreeSuite) TestAddUnmodified(c *C) {
1759 fs := memfs.New()
1760 w := &Worktree{
1761 r: s.Repository,
1762 Filesystem: fs,
1763 }
1764
1765 err := w.Checkout(&CheckoutOptions{Force: true})
1766 c.Assert(err, IsNil)
1767
1768 hash, err := w.Add("LICENSE")
1769 c.Assert(hash.String(), Equals, "c192bd6a24ea1ab01d78686e417c8bdc7c3d197f")
1770 c.Assert(err, IsNil)
1771}
1772
1773func (s *WorktreeSuite) TestAddRemoved(c *C) {
1774 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