(c *C)
| 26 | ) |
| 27 | |
| 28 | func (s *WorktreeSuite) TestCommitEmptyOptions(c *C) { |
| 29 | fs := memfs.New() |
| 30 | r, err := Init(memory.NewStorage(), fs) |
| 31 | c.Assert(err, IsNil) |
| 32 | |
| 33 | w, err := r.Worktree() |
| 34 | c.Assert(err, IsNil) |
| 35 | |
| 36 | util.WriteFile(fs, "foo", []byte("foo"), 0644) |
| 37 | |
| 38 | _, err = w.Add("foo") |
| 39 | c.Assert(err, IsNil) |
| 40 | |
| 41 | hash, err := w.Commit("foo", &CommitOptions{}) |
| 42 | c.Assert(err, IsNil) |
| 43 | c.Assert(hash.IsZero(), Equals, false) |
| 44 | |
| 45 | commit, err := r.CommitObject(hash) |
| 46 | c.Assert(err, IsNil) |
| 47 | c.Assert(commit.Author.Name, Not(Equals), "") |
| 48 | } |
| 49 | |
| 50 | func (s *WorktreeSuite) TestCommitInitial(c *C) { |
| 51 | expected := plumbing.NewHash("98c4ac7c29c913f7461eae06e024dc18e80d23a4") |
nothing calls this directly
no test coverage detected