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

Method TestCreateRemoteAndRemote

repository_test.go:331–345  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

329}
330
331func (s *RepositorySuite) TestCreateRemoteAndRemote(c *C) {
332 r, _ := Init(memory.NewStorage(), nil)
333 remote, err := r.CreateRemote(&config.RemoteConfig{
334 Name: "foo",
335 URLs: []string{"http://foo/foo.git"},
336 })
337
338 c.Assert(err, IsNil)
339 c.Assert(remote.Config().Name, Equals, "foo")
340
341 alt, err := r.Remote("foo")
342 c.Assert(err, IsNil)
343 c.Assert(alt, Not(Equals), remote)
344 c.Assert(alt.Config().Name, Equals, "foo")
345}
346
347func (s *RepositorySuite) TestCreateRemoteInvalid(c *C) {
348 r, _ := Init(memory.NewStorage(), nil)

Callers

nothing calls this directly

Calls 5

NewStorageFunction · 0.92
InitFunction · 0.85
CreateRemoteMethod · 0.80
RemoteMethod · 0.80
ConfigMethod · 0.65

Tested by

no test coverage detected