(c *C, r *Repository)
| 83 | } |
| 84 | |
| 85 | func createCommit(c *C, r *Repository) plumbing.Hash { |
| 86 | // Create a commit so there is a HEAD to check |
| 87 | wt, err := r.Worktree() |
| 88 | c.Assert(err, IsNil) |
| 89 | |
| 90 | rm, err := wt.Filesystem.Create("foo.txt") |
| 91 | c.Assert(err, IsNil) |
| 92 | |
| 93 | _, err = rm.Write([]byte("foo text")) |
| 94 | c.Assert(err, IsNil) |
| 95 | |
| 96 | _, err = wt.Add("foo.txt") |
| 97 | c.Assert(err, IsNil) |
| 98 | |
| 99 | author := object.Signature{ |
| 100 | Name: "go-git", |
| 101 | Email: "go-git@fake.local", |
| 102 | When: time.Now(), |
| 103 | } |
| 104 | |
| 105 | h, err := wt.Commit("test commit message", &CommitOptions{ |
| 106 | All: true, |
| 107 | Author: &author, |
| 108 | Committer: &author, |
| 109 | AllowEmptyCommits: true, |
| 110 | }) |
| 111 | c.Assert(err, IsNil) |
| 112 | return h |
| 113 | } |
| 114 | |
| 115 | func (s *RepositorySuite) TestInitNonStandardDotGit(c *C) { |
| 116 | dir := c.MkDir() |
no test coverage detected
searching dependent graphs…