aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object/commit_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2020-05-13 11:58:48 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2020-05-13 11:58:48 +0200
commit08da9bb09f6046c7344f537fc4a819ed03d23f55 (patch)
treed1219883c236444ee791ddf378713050f2430a4a /plumbing/object/commit_test.go
parent568154cab87659b31c751678c7f7dc93fedf60af (diff)
downloadgo-git-08da9bb09f6046c7344f537fc4a819ed03d23f55.tar.gz
plumbing: object, Commit.Patch support to as nil
Diffstat (limited to 'plumbing/object/commit_test.go')
-rw-r--r--plumbing/object/commit_test.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/plumbing/object/commit_test.go b/plumbing/object/commit_test.go
index 28a7a81..e260a7f 100644
--- a/plumbing/object/commit_test.go
+++ b/plumbing/object/commit_test.go
@@ -12,8 +12,8 @@ import (
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/cache"
- . "gopkg.in/check.v1"
"github.com/go-git/go-git/v5/storage/filesystem"
+ . "gopkg.in/check.v1"
)
type SuiteCommit struct {
@@ -188,6 +188,15 @@ Binary files /dev/null and b/binary.jpg differ
c.Assert(buf.String(), Equals, patch.String())
}
+func (s *SuiteCommit) TestPatchContext_ToNil(c *C) {
+ from := s.commit(c, plumbing.NewHash("918c48b83bd081e863dbe1b80f8998f058cd8294"))
+
+ patch, err := from.PatchContext(context.Background(), nil)
+ c.Assert(err, IsNil)
+
+ c.Assert(len(patch.String()), Equals, 242679)
+}
+
func (s *SuiteCommit) TestCommitEncodeDecodeIdempotent(c *C) {
ts, err := time.Parse(time.RFC3339, "2006-01-02T15:04:05-07:00")
c.Assert(err, IsNil)