diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2020-05-24 11:23:04 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2020-05-24 11:23:04 +0200 |
commit | 86c0c010927fe59ae54563a9a86db200a18f4c2e (patch) | |
tree | f83e183db75f414163ab8422ac6e00c0f6eebf31 /worktree_commit_test.go | |
parent | 26d02b3fec4434d663445d580497204e79284db0 (diff) | |
download | go-git-86c0c010927fe59ae54563a9a86db200a18f4c2e.tar.gz |
Repository.ConfigScoped and Repository.Commit with empty author support
Diffstat (limited to 'worktree_commit_test.go')
-rw-r--r-- | worktree_commit_test.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/worktree_commit_test.go b/worktree_commit_test.go index aeb4a9a..6eafb15 100644 --- a/worktree_commit_test.go +++ b/worktree_commit_test.go @@ -24,16 +24,20 @@ import ( . "gopkg.in/check.v1" ) -func (s *WorktreeSuite) TestCommitInvalidOptions(c *C) { +func (s *WorktreeSuite) TestCommitEmptyOptions(c *C) { r, err := Init(memory.NewStorage(), memfs.New()) c.Assert(err, IsNil) w, err := r.Worktree() c.Assert(err, IsNil) - hash, err := w.Commit("", &CommitOptions{}) - c.Assert(err, Equals, ErrMissingAuthor) - c.Assert(hash.IsZero(), Equals, true) + hash, err := w.Commit("foo", &CommitOptions{}) + c.Assert(err, IsNil) + c.Assert(hash.IsZero(), Equals, false) + + commit, err := r.CommitObject(hash) + c.Assert(err, IsNil) + c.Assert(commit.Author.Name, Not(Equals), "") } func (s *WorktreeSuite) TestCommitInitial(c *C) { |