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