aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/index/decoder_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2018-11-19 23:23:42 +0100
committerGitHub <noreply@github.com>2018-11-19 23:23:42 +0100
commitf62cd8e3495579a8323455fa0c4e6c44bb0d5e09 (patch)
tree22c4649f1e93076d96a263cdd876cb8a7e16694c /plumbing/format/index/decoder_test.go
parent2431109797aa48f33c0be2066c58f0cad0578ecc (diff)
parentb99653a9d3d231a9e1e4a1ddca41a08b3b733ae9 (diff)
downloadgo-git-f62cd8e3495579a8323455fa0c4e6c44bb0d5e09.tar.gz
Merge pull request #1025 from mcuadros/eoiev4.8.0
plumbing: format/index: support for EOIE extension
Diffstat (limited to 'plumbing/format/index/decoder_test.go')
-rw-r--r--plumbing/format/index/decoder_test.go16
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")
+}