diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2017-01-28 18:40:43 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2017-01-28 18:40:43 +0100 |
commit | 60124e2bfd15c76738d429368b05a13f537a27d9 (patch) | |
tree | 645b152da4cad81f00c827c0f79d67fb21e150a3 /plumbing/format/index/decoder_test.go | |
parent | 9a9f2b1f63a98fad67a3190ef813428b68dfdd8c (diff) | |
download | go-git-60124e2bfd15c76738d429368b05a13f537a27d9.tar.gz |
format/index: keep time.Time as zero, when decoded value is 0
Diffstat (limited to 'plumbing/format/index/decoder_test.go')
-rw-r--r-- | plumbing/format/index/decoder_test.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/plumbing/format/index/decoder_test.go b/plumbing/format/index/decoder_test.go index 4614701..47a8186 100644 --- a/plumbing/format/index/decoder_test.go +++ b/plumbing/format/index/decoder_test.go @@ -41,6 +41,7 @@ func (s *IndexSuite) TestDecodeEntries(c *C) { c.Assert(idx.Entries, HasLen, 9) e := idx.Entries[0] + c.Assert(e.CreatedAt.Unix(), Equals, int64(1480626693)) c.Assert(e.CreatedAt.Nanosecond(), Equals, 498593596) c.Assert(e.ModifiedAt.Unix(), Equals, int64(1480626693)) @@ -111,10 +112,8 @@ func (s *IndexSuite) TestDecodeMergeConflict(c *C) { // stagged files for i, e := range idx.Entries[4:7] { c.Assert(e.Stage, Equals, expected[i].Stage) - c.Assert(e.CreatedAt.Unix(), Equals, int64(0)) - c.Assert(e.CreatedAt.Nanosecond(), Equals, 0) - c.Assert(e.ModifiedAt.Unix(), Equals, int64(0)) - c.Assert(e.ModifiedAt.Nanosecond(), Equals, 0) + c.Assert(e.CreatedAt.IsZero(), Equals, true) + c.Assert(e.ModifiedAt.IsZero(), Equals, true) c.Assert(e.Dev, Equals, uint32(0)) c.Assert(e.Inode, Equals, uint32(0)) c.Assert(e.UID, Equals, uint32(0)) |