aboutsummaryrefslogtreecommitdiffstats
path: root/worktree_commit_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2020-05-24 16:53:30 +0200
committerGitHub <noreply@github.com>2020-05-24 16:53:30 +0200
commite7f544844d6d736acfd9d75ee0d4a9d37f450103 (patch)
treedc44247231e6603bf10acaee91af5523120b4b84 /worktree_commit_test.go
parent6d8103df45ce09ffd5323b4ef46d26440400a54f (diff)
parentbaf8c2761217cd457ef672972d5c1fb4d066e95a (diff)
downloadgo-git-e7f544844d6d736acfd9d75ee0d4a9d37f450103.tar.gz
Merge pull request #75 from mcuadros/scope-config
repository.ConfigScoped and worktree.Commit with empty CommitOptions
Diffstat (limited to 'worktree_commit_test.go')
-rw-r--r--worktree_commit_test.go12
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) {