(c *C)
| 90 | } |
| 91 | |
| 92 | func (s *WorktreeSuite) TestCommitParent(c *C) { |
| 93 | expected := plumbing.NewHash("ef3ca05477530b37f48564be33ddd48063fc7a22") |
| 94 | |
| 95 | fs := memfs.New() |
| 96 | w := &Worktree{ |
| 97 | r: s.Repository, |
| 98 | Filesystem: fs, |
| 99 | } |
| 100 | |
| 101 | err := w.Checkout(&CheckoutOptions{}) |
| 102 | c.Assert(err, IsNil) |
| 103 | |
| 104 | util.WriteFile(fs, "foo", []byte("foo"), 0644) |
| 105 | |
| 106 | _, err = w.Add("foo") |
| 107 | c.Assert(err, IsNil) |
| 108 | |
| 109 | hash, err := w.Commit("foo\n", &CommitOptions{Author: defaultSignature()}) |
| 110 | c.Assert(hash, Equals, expected) |
| 111 | c.Assert(err, IsNil) |
| 112 | |
| 113 | assertStorageStatus(c, s.Repository, 13, 11, 10, expected) |
| 114 | } |
| 115 | |
| 116 | func (s *WorktreeSuite) TestCommitAmend(c *C) { |
| 117 | fs := memfs.New() |
nothing calls this directly
no test coverage detected