MCPcopy
hub / github.com/go-git/go-git / TestCommitOptionsLoadGlobalCommitter

Method TestCommitOptionsLoadGlobalCommitter

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

Source from the content-addressed store, hash-verified

58}
59
60func (s *OptionsSuite) TestCommitOptionsLoadGlobalCommitter(c *C) {
61 cfg := config.NewConfig()
62 cfg.User.Name = "foo"
63 cfg.User.Email = "foo@foo.com"
64 cfg.Committer.Name = "bar"
65 cfg.Committer.Email = "bar@bar.com"
66
67 clean := s.writeGlobalConfig(c, cfg)
68 defer clean()
69
70 o := CommitOptions{}
71 err := o.Validate(s.Repository)
72 c.Assert(err, IsNil)
73
74 c.Assert(o.Author.Name, Equals, "foo")
75 c.Assert(o.Author.Email, Equals, "foo@foo.com")
76 c.Assert(o.Committer.Name, Equals, "bar")
77 c.Assert(o.Committer.Email, Equals, "bar@bar.com")
78}
79
80func (s *OptionsSuite) TestCreateTagOptionsLoadGlobal(c *C) {
81 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