MCPcopy Create free account
hub / github.com/go-git/go-git / TestAddAndCommitEmpty

Method TestAddAndCommitEmpty

worktree_test.go:2851–2870  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

2849}
2850
2851func (s *WorktreeSuite) TestAddAndCommitEmpty(c *C) {
2852 dir, clean := s.TemporalDir()
2853 defer clean()
2854
2855 repo, err := PlainInit(dir, false)
2856 c.Assert(err, IsNil)
2857
2858 w, err := repo.Worktree()
2859 c.Assert(err, IsNil)
2860
2861 _, err = w.Add(".")
2862 c.Assert(err, IsNil)
2863
2864 _, err = w.Commit("Test Add And Commit", &CommitOptions{Author: &object.Signature{
2865 Name: "foo",
2866 Email: "foo@foo.foo",
2867 When: time.Now(),
2868 }})
2869 c.Assert(err, Equals, ErrEmptyCommit)
2870}
2871
2872func (s *WorktreeSuite) TestLinkedWorktree(c *C) {
2873 fs := fixtures.ByTag("linked-worktree").One().Worktree()

Callers

nothing calls this directly

Calls 5

PlainInitFunction · 0.85
TemporalDirMethod · 0.80
WorktreeMethod · 0.80
CommitMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected