(c *C)
| 49 | } |
| 50 | |
| 51 | func (s *WorktreeSuite) TestCommitInitial(c *C) { |
| 52 | expected := plumbing.NewHash("98c4ac7c29c913f7461eae06e024dc18e80d23a4") |
| 53 | |
| 54 | fs := memfs.New() |
| 55 | storage := memory.NewStorage() |
| 56 | |
| 57 | r, err := Init(storage, fs) |
| 58 | c.Assert(err, IsNil) |
| 59 | |
| 60 | w, err := r.Worktree() |
| 61 | c.Assert(err, IsNil) |
| 62 | |
| 63 | util.WriteFile(fs, "foo", []byte("foo"), 0644) |
| 64 | |
| 65 | _, err = w.Add("foo") |
| 66 | c.Assert(err, IsNil) |
| 67 | |
| 68 | hash, err := w.Commit("foo\n", &CommitOptions{Author: defaultSignature()}) |
| 69 | c.Assert(hash, Equals, expected) |
| 70 | c.Assert(err, IsNil) |
| 71 | |
| 72 | assertStorageStatus(c, r, 1, 1, 1, expected) |
| 73 | } |
| 74 | |
| 75 | func (s *WorktreeSuite) TestNothingToCommit(c *C) { |
| 76 | expected := plumbing.NewHash("838ea833ce893e8555907e5ef224aa076f5e274a") |
nothing calls this directly
no test coverage detected