(c *C)
| 280 | } |
| 281 | |
| 282 | func (s *WorktreeSuite) TestAddAndCommitWithSkipStatus(c *C) { |
| 283 | expected := plumbing.NewHash("375a3808ffde7f129cdd3c8c252fd0fe37cfd13b") |
| 284 | |
| 285 | fs := memfs.New() |
| 286 | w := &Worktree{ |
| 287 | r: s.Repository, |
| 288 | Filesystem: fs, |
| 289 | } |
| 290 | |
| 291 | err := w.Checkout(&CheckoutOptions{}) |
| 292 | c.Assert(err, IsNil) |
| 293 | |
| 294 | util.WriteFile(fs, "LICENSE", []byte("foo"), 0644) |
| 295 | util.WriteFile(fs, "foo", []byte("foo"), 0644) |
| 296 | |
| 297 | err = w.AddWithOptions(&AddOptions{ |
| 298 | Path: "foo", |
| 299 | SkipStatus: true, |
| 300 | }) |
| 301 | c.Assert(err, IsNil) |
| 302 | |
| 303 | hash, err := w.Commit("commit foo only\n", &CommitOptions{ |
| 304 | Author: defaultSignature(), |
| 305 | }) |
| 306 | |
| 307 | c.Assert(hash, Equals, expected) |
| 308 | c.Assert(err, IsNil) |
| 309 | |
| 310 | assertStorageStatus(c, s.Repository, 13, 11, 10, expected) |
| 311 | } |
| 312 | |
| 313 | func (s *WorktreeSuite) TestAddAndCommitWithSkipStatusPathNotModified(c *C) { |
| 314 | expected := plumbing.NewHash("375a3808ffde7f129cdd3c8c252fd0fe37cfd13b") |
nothing calls this directly
no test coverage detected