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

Method TestStringMultiLine

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

Source from the content-addressed store, hash-verified

303}
304
305func (s *SuiteCommit) TestStringMultiLine(c *C) {
306 hash := plumbing.NewHash("e7d896db87294e33ca3202e536d4d9bb16023db3")
307
308 f := fixtures.ByURL("https://github.com/src-d/go-git.git").One()
309 sto := filesystem.NewStorage(f.DotGit(), cache.NewObjectLRUDefault())
310
311 o, err := sto.EncodedObject(plumbing.CommitObject, hash)
312 c.Assert(err, IsNil)
313 commit, err := DecodeCommit(sto, o)
314 c.Assert(err, IsNil)
315
316 c.Assert(commit.String(), Equals, ""+
317 "commit e7d896db87294e33ca3202e536d4d9bb16023db3\n"+
318 "Author: Alberto Cortés <alberto@sourced.tech>\n"+
319 "Date: Wed Jan 27 11:13:49 2016 +0100\n"+
320 "\n"+
321 " fix zlib invalid header error\n"+
322 "\n"+
323 " The return value of reads to the packfile were being ignored, so zlib\n"+
324 " was getting invalid data on it read buffers.\n"+
325 "\n",
326 )
327}
328
329func (s *SuiteCommit) TestCommitIterNext(c *C) {
330 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