2 Star 0 Fork 7

hequan / go-git

forked from Gitee 极速下载 / go-git 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
options_test.go 748 Bytes
一键复制 编辑 原始数据 按行查看 历史
package git
import (
. "gopkg.in/check.v1"
"gopkg.in/src-d/go-git.v4/plumbing/object"
)
type OptionsSuite struct {
BaseSuite
}
var _ = Suite(&OptionsSuite{})
func (s *OptionsSuite) TestCommitOptionsParentsFromHEAD(c *C) {
o := CommitOptions{Author: &object.Signature{}}
err := o.Validate(s.Repository)
c.Assert(err, IsNil)
c.Assert(o.Parents, HasLen, 1)
}
func (s *OptionsSuite) TestCommitOptionsMissingAuthor(c *C) {
o := CommitOptions{}
err := o.Validate(s.Repository)
c.Assert(err, Equals, ErrMissingAuthor)
}
func (s *OptionsSuite) TestCommitOptionsCommitter(c *C) {
sig := &object.Signature{}
o := CommitOptions{Author: sig}
err := o.Validate(s.Repository)
c.Assert(err, IsNil)
c.Assert(o.Committer, Equals, o.Author)
}
Go
1
https://gitee.com/hequan2020/go-git.git
git@gitee.com:hequan2020/go-git.git
hequan2020
go-git
go-git
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891