diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2018-11-19 15:40:26 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2018-11-19 15:40:26 +0100 |
commit | b99653a9d3d231a9e1e4a1ddca41a08b3b733ae9 (patch) | |
tree | 110a980b1d91ddffdb9a156edc32d3b516aebec3 /plumbing/format/index/decoder_test.go | |
parent | a779a263330bc497181136072e7a484fefb51323 (diff) | |
download | go-git-b99653a9d3d231a9e1e4a1ddca41a08b3b733ae9.tar.gz |
plumbing: format/index: support for EOIE extension, by default on git v2.2.0
Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
Diffstat (limited to 'plumbing/format/index/decoder_test.go')
-rw-r--r-- | plumbing/format/index/decoder_test.go | 16 |
1 files changed, 16 insertions, 0 deletions
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") +} |