(c *C)
| 303 | } |
| 304 | |
| 305 | func (s *WorktreeSuite) TestRemoveAndCommitAll(c *C) { |
| 306 | expected := plumbing.NewHash("907cd576c6ced2ecd3dab34a72bf9cf65944b9a9") |
| 307 | |
| 308 | fs := memfs.New() |
| 309 | w := &Worktree{ |
| 310 | r: s.Repository, |
| 311 | Filesystem: fs, |
| 312 | } |
| 313 | |
| 314 | err := w.Checkout(&CheckoutOptions{}) |
| 315 | c.Assert(err, IsNil) |
| 316 | |
| 317 | util.WriteFile(fs, "foo", []byte("foo"), 0644) |
| 318 | _, err = w.Add("foo") |
| 319 | c.Assert(err, IsNil) |
| 320 | |
| 321 | _, errFirst := w.Commit("Add in Repo\n", &CommitOptions{ |
| 322 | Author: defaultSignature(), |
| 323 | }) |
| 324 | c.Assert(errFirst, IsNil) |
| 325 | |
| 326 | errRemove := fs.Remove("foo") |
| 327 | c.Assert(errRemove, IsNil) |
| 328 | |
| 329 | hash, errSecond := w.Commit("Remove foo\n", &CommitOptions{ |
| 330 | All: true, |
| 331 | Author: defaultSignature(), |
| 332 | }) |
| 333 | c.Assert(errSecond, IsNil) |
| 334 | |
| 335 | c.Assert(hash, Equals, expected) |
| 336 | c.Assert(err, IsNil) |
| 337 | |
| 338 | assertStorageStatus(c, s.Repository, 13, 11, 11, expected) |
| 339 | } |
| 340 | |
| 341 | func (s *WorktreeSuite) TestCommitSign(c *C) { |
| 342 | fs := memfs.New() |
nothing calls this directly
no test coverage detected