diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-09-09 17:38:13 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-09-09 17:38:13 +0200 |
commit | 7c0ca21db6741af7735e3be332987e362393fb07 (patch) | |
tree | 3fc1432e51e2987fd6786f2e5d0738be4047af19 /formats/packfile/parser_test.go | |
parent | a951c2b1708c8b32d92aa627bc2ed7f50dd6a91a (diff) | |
download | go-git-7c0ca21db6741af7735e3be332987e362393fb07.tar.gz |
format: packfile ignores the header if not read
Diffstat (limited to 'formats/packfile/parser_test.go')
-rw-r--r-- | formats/packfile/parser_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/formats/packfile/parser_test.go b/formats/packfile/parser_test.go index d746b98..2ff2887 100644 --- a/formats/packfile/parser_test.go +++ b/formats/packfile/parser_test.go @@ -26,6 +26,20 @@ func (s *ScannerSuite) TestHeader(c *C) { c.Assert(objects, Equals, uint32(31)) } +func (s *ScannerSuite) TestNextObjectHeaderWithoutHeader(c *C) { + r := fixtures.Basic().One().Packfile() + p := NewScanner(r) + + h, err := p.NextObjectHeader() + c.Assert(err, IsNil) + c.Assert(h, DeepEquals, &expectedHeadersOFS[0]) + + version, objects, err := p.Header() + c.Assert(err, IsNil) + c.Assert(version, Equals, VersionSupported) + c.Assert(objects, Equals, uint32(31)) +} + func (s *ScannerSuite) TestNextObjectHeaderREFDelta(c *C) { s.testNextObjectHeader(c, "ref-delta", expectedHeadersREF) } |