diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2020-05-13 12:11:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-13 12:11:00 +0200 |
commit | 6f9eb4ef0f8b33763ba79a0ceaaf71dd6db6255a (patch) | |
tree | d1219883c236444ee791ddf378713050f2430a4a /plumbing/object/tree_test.go | |
parent | 568154cab87659b31c751678c7f7dc93fedf60af (diff) | |
parent | 08da9bb09f6046c7344f537fc4a819ed03d23f55 (diff) | |
download | go-git-6f9eb4ef0f8b33763ba79a0ceaaf71dd6db6255a.tar.gz |
Merge pull request #62 from mcuadros/commit-patch-nil
plumbing: object, Commit.Patch support to as nil
Diffstat (limited to 'plumbing/object/tree_test.go')
-rw-r--r-- | plumbing/object/tree_test.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/plumbing/object/tree_test.go b/plumbing/object/tree_test.go index 474bb6a..d9dad47 100644 --- a/plumbing/object/tree_test.go +++ b/plumbing/object/tree_test.go @@ -377,6 +377,17 @@ func (s *TreeSuite) TestTreeWalkerNextNonRecursive(c *C) { c.Assert(count, Equals, 8) } +func (s *TreeSuite) TestPatchContext_ToNil(c *C) { + commit := s.commit(c, plumbing.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5")) + tree, err := commit.Tree() + c.Assert(err, IsNil) + + patch, err := tree.PatchContext(context.Background(), nil) + c.Assert(err, IsNil) + + c.Assert(len(patch.String()), Equals, 242971) +} + func (s *TreeSuite) TestTreeWalkerNextSubmodule(c *C) { dotgit := fixtures.ByURL("https://github.com/git-fixtures/submodule.git").One().DotGit() st := filesystem.NewStorage(dotgit, cache.NewObjectLRUDefault()) |