MCPcopy Index your code
hub / github.com/go-git/go-git / TestStringMultiLine

Method TestStringMultiLine

plumbing/object/commit_test.go:350–372  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

348}
349
350func (s *SuiteCommit) TestStringMultiLine(c *C) {
351 hash := plumbing.NewHash("e7d896db87294e33ca3202e536d4d9bb16023db3")
352
353 f := fixtures.ByURL("https://github.com/src-d/go-git.git").One()
354 sto := filesystem.NewStorage(f.DotGit(), cache.NewObjectLRUDefault())
355
356 o, err := sto.EncodedObject(plumbing.CommitObject, hash)
357 c.Assert(err, IsNil)
358 commit, err := DecodeCommit(sto, o)
359 c.Assert(err, IsNil)
360
361 c.Assert(commit.String(), Equals, ""+
362 "commit e7d896db87294e33ca3202e536d4d9bb16023db3\n"+
363 "Author: Alberto Cortés <alberto@sourced.tech>\n"+
364 "Date: Wed Jan 27 11:13:49 2016 +0100\n"+
365 "\n"+
366 " fix zlib invalid header error\n"+
367 "\n"+
368 " The return value of reads to the packfile were being ignored, so zlib\n"+
369 " was getting invalid data on it read buffers.\n"+
370 "\n",
371 )
372}
373
374func (s *SuiteCommit) TestCommitIterNext(c *C) {
375 i := s.Commit.Parents()

Callers

nothing calls this directly

Calls 6

NewHashFunction · 0.92
NewStorageFunction · 0.92
NewObjectLRUDefaultFunction · 0.92
DecodeCommitFunction · 0.85
EncodedObjectMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected