From b99653a9d3d231a9e1e4a1ddca41a08b3b733ae9 Mon Sep 17 00:00:00 2001 From: Máximo Cuadros Date: Mon, 19 Nov 2018 15:40:26 +0100 Subject: plumbing: format/index: support for EOIE extension, by default on git v2.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Máximo Cuadros --- plumbing/format/index/decoder_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'plumbing/format/index/decoder_test.go') diff --git a/plumbing/format/index/decoder_test.go b/plumbing/format/index/decoder_test.go index b612ebb..7468ad0 100644 --- a/plumbing/format/index/decoder_test.go +++ b/plumbing/format/index/decoder_test.go @@ -202,3 +202,19 @@ func (s *IndexSuite) TestDecodeV4(c *C) { c.Assert(idx.Entries[6].IntentToAdd, Equals, true) c.Assert(idx.Entries[6].SkipWorktree, Equals, false) } + +func (s *IndexSuite) TestDecodeEndOfIndexEntry(c *C) { + f, err := fixtures.Basic().ByTag("end-of-index-entry").One().DotGit().Open("index") + c.Assert(err, IsNil) + defer func() { c.Assert(f.Close(), IsNil) }() + + idx := &Index{} + d := NewDecoder(f) + err = d.Decode(idx) + c.Assert(err, IsNil) + + c.Assert(idx.Version, Equals, uint32(2)) + c.Assert(idx.EndOfIndexEntry, NotNil) + c.Assert(idx.EndOfIndexEntry.Offset, Equals, uint32(716)) + c.Assert(idx.EndOfIndexEntry.Hash.String(), Equals, "922e89d9ffd7cefce93a211615b2053c0f42bd78") +} -- cgit