(c *C)
| 165 | } |
| 166 | |
| 167 | func (s *WorktreeSuite) TestAddAndCommitWithSkipStatus(c *C) { |
| 168 | expected := plumbing.NewHash("375a3808ffde7f129cdd3c8c252fd0fe37cfd13b") |
| 169 | |
| 170 | fs := memfs.New() |
| 171 | w := &Worktree{ |
| 172 | r: s.Repository, |
| 173 | Filesystem: fs, |
| 174 | } |
| 175 | |
| 176 | err := w.Checkout(&CheckoutOptions{}) |
| 177 | c.Assert(err, IsNil) |
| 178 | |
| 179 | util.WriteFile(fs, "LICENSE", []byte("foo"), 0644) |
| 180 | util.WriteFile(fs, "foo", []byte("foo"), 0644) |
| 181 | |
| 182 | err = w.AddWithOptions(&AddOptions{ |
| 183 | Path: "foo", |
| 184 | SkipStatus: true, |
| 185 | }) |
| 186 | c.Assert(err, IsNil) |
| 187 | |
| 188 | hash, err := w.Commit("commit foo only\n", &CommitOptions{ |
| 189 | Author: defaultSignature(), |
| 190 | }) |
| 191 | |
| 192 | c.Assert(hash, Equals, expected) |
| 193 | c.Assert(err, IsNil) |
| 194 | |
| 195 | assertStorageStatus(c, s.Repository, 13, 11, 10, expected) |
| 196 | } |
| 197 | |
| 198 | func (s *WorktreeSuite) TestAddAndCommitWithSkipStatusPathNotModified(c *C) { |
| 199 | expected := plumbing.NewHash("375a3808ffde7f129cdd3c8c252fd0fe37cfd13b") |
nothing calls this directly
no test coverage detected