(c *C)
| 141 | } |
| 142 | |
| 143 | func (s *WorktreeSuite) TestCommitParent(c *C) { |
| 144 | expected := plumbing.NewHash("ef3ca05477530b37f48564be33ddd48063fc7a22") |
| 145 | |
| 146 | fs := memfs.New() |
| 147 | w := &Worktree{ |
| 148 | r: s.Repository, |
| 149 | Filesystem: fs, |
| 150 | } |
| 151 | |
| 152 | err := w.Checkout(&CheckoutOptions{}) |
| 153 | c.Assert(err, IsNil) |
| 154 | |
| 155 | err = util.WriteFile(fs, "foo", []byte("foo"), 0644) |
| 156 | c.Assert(err, IsNil) |
| 157 | |
| 158 | _, err = w.Add("foo") |
| 159 | c.Assert(err, IsNil) |
| 160 | |
| 161 | hash, err := w.Commit("foo\n", &CommitOptions{Author: defaultSignature()}) |
| 162 | c.Assert(hash, Equals, expected) |
| 163 | c.Assert(err, IsNil) |
| 164 | |
| 165 | assertStorageStatus(c, s.Repository, 13, 11, 10, expected) |
| 166 | } |
| 167 | |
| 168 | func (s *WorktreeSuite) TestCommitAmendWithoutChanges(c *C) { |
| 169 | fs := memfs.New() |
nothing calls this directly
no test coverage detected