aboutsummaryrefslogtreecommitdiffstats
path: root/objects_test.go
diff options
context:
space:
mode:
authorJoshua Sjoding <joshua.sjoding@scjalliance.com>2016-02-17 12:01:02 -0800
committerJoshua Sjoding <joshua.sjoding@scjalliance.com>2016-02-17 12:01:02 -0800
commita72c4ec54bb0502bd230dd007ebd1ef7b381afc7 (patch)
tree0cc85b4632818b7e9dd72d27a10698843304837b /objects_test.go
parent9df17e545a445f58c5c43a1ece49bf1ff09e3b02 (diff)
downloadgo-git-a72c4ec54bb0502bd230dd007ebd1ef7b381afc7.tar.gz
Tree.Entries is now a slice
Tree's mapping of names to entries has been made internal, and will only be built when necessary with the first call to Tree.File().
Diffstat (limited to 'objects_test.go')
-rw-r--r--objects_test.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/objects_test.go b/objects_test.go
index eadf65a..4745774 100644
--- a/objects_test.go
+++ b/objects_test.go
@@ -54,9 +54,12 @@ func (s *ObjectsSuite) TestParseTree(c *C) {
c.Assert(err, IsNil)
c.Assert(tree.Entries, HasLen, 8)
- c.Assert(tree.Entries[".gitignore"].Name, Equals, ".gitignore")
- c.Assert(tree.Entries[".gitignore"].Mode.String(), Equals, "-rw-r--r--")
- c.Assert(tree.Entries[".gitignore"].Hash.String(), Equals, "32858aad3c383ed1ff0a0f9bdf231d54a00c9e88")
+
+ tree.buildMap()
+ c.Assert(tree.m, HasLen, 8)
+ c.Assert(tree.m[".gitignore"].Name, Equals, ".gitignore")
+ c.Assert(tree.m[".gitignore"].Mode.String(), Equals, "-rw-r--r--")
+ c.Assert(tree.m[".gitignore"].Hash.String(), Equals, "32858aad3c383ed1ff0a0f9bdf231d54a00c9e88")
count := 0
iter := tree.Files()