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

Method TestCreateBranchAndBranch

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

Source from the content-addressed store, hash-verified

416}
417
418func (s *RepositorySuite) TestCreateBranchAndBranch(c *C) {
419 r, _ := Init(memory.NewStorage(), nil)
420 testBranch := &config.Branch{
421 Name: "foo",
422 Remote: "origin",
423 Merge: "refs/heads/foo",
424 }
425 err := r.CreateBranch(testBranch)
426
427 c.Assert(err, IsNil)
428 cfg, err := r.Config()
429 c.Assert(err, IsNil)
430 c.Assert(len(cfg.Branches), Equals, 1)
431 branch := cfg.Branches["foo"]
432 c.Assert(branch.Name, Equals, testBranch.Name)
433 c.Assert(branch.Remote, Equals, testBranch.Remote)
434 c.Assert(branch.Merge, Equals, testBranch.Merge)
435
436 branch, err = r.Branch("foo")
437 c.Assert(err, IsNil)
438 c.Assert(branch.Name, Equals, testBranch.Name)
439 c.Assert(branch.Remote, Equals, testBranch.Remote)
440 c.Assert(branch.Merge, Equals, testBranch.Merge)
441}
442
443func (s *RepositorySuite) TestMergeFF(c *C) {
444 r, err := Init(memory.NewStorage(), memfs.New())

Callers

nothing calls this directly

Calls 5

NewStorageFunction · 0.92
InitFunction · 0.85
CreateBranchMethod · 0.80
BranchMethod · 0.80
ConfigMethod · 0.65

Tested by

no test coverage detected