MCPcopy Index your code
hub / github.com/go-git/go-git / TestCommitOptionsLoadGlobalConfigUser

Method TestCommitOptionsLoadGlobalConfigUser

options_test.go:42–58  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

40}
41
42func (s *OptionsSuite) TestCommitOptionsLoadGlobalConfigUser(c *C) {
43 cfg := config.NewConfig()
44 cfg.User.Name = "foo"
45 cfg.User.Email = "foo@foo.com"
46
47 clean := s.writeGlobalConfig(c, cfg)
48 defer clean()
49
50 o := CommitOptions{}
51 err := o.Validate(s.Repository)
52 c.Assert(err, IsNil)
53
54 c.Assert(o.Author.Name, Equals, "foo")
55 c.Assert(o.Author.Email, Equals, "foo@foo.com")
56 c.Assert(o.Committer.Name, Equals, "foo")
57 c.Assert(o.Committer.Email, Equals, "foo@foo.com")
58}
59
60func (s *OptionsSuite) TestCommitOptionsLoadGlobalCommitter(c *C) {
61 cfg := config.NewConfig()

Callers

nothing calls this directly

Calls 3

writeGlobalConfigMethod · 0.95
ValidateMethod · 0.95
NewConfigFunction · 0.92

Tested by

no test coverage detected