(c *C)
| 72 | } |
| 73 | |
| 74 | func (s *WorktreeSuite) TestNothingToCommit(c *C) { |
| 75 | expected := plumbing.NewHash("838ea833ce893e8555907e5ef224aa076f5e274a") |
| 76 | |
| 77 | r, err := Init(memory.NewStorage(), memfs.New()) |
| 78 | c.Assert(err, IsNil) |
| 79 | |
| 80 | w, err := r.Worktree() |
| 81 | c.Assert(err, IsNil) |
| 82 | |
| 83 | hash, err := w.Commit("failed empty commit\n", &CommitOptions{Author: defaultSignature()}) |
| 84 | c.Assert(hash, Equals, plumbing.ZeroHash) |
| 85 | c.Assert(err, Equals, ErrEmptyCommit) |
| 86 | |
| 87 | hash, err = w.Commit("enable empty commits\n", &CommitOptions{Author: defaultSignature(), AllowEmptyCommits: true}) |
| 88 | c.Assert(hash, Equals, expected) |
| 89 | c.Assert(err, IsNil) |
| 90 | } |
| 91 | |
| 92 | func (s *WorktreeSuite) TestCommitParent(c *C) { |
| 93 | expected := plumbing.NewHash("ef3ca05477530b37f48564be33ddd48063fc7a22") |
nothing calls this directly
no test coverage detected