aboutsummaryrefslogtreecommitdiffstats
path: root/tree_test.go
Commit message (Collapse)AuthorAgeFilesLines
* New iteration behavior via FileIter and TreeWalkerJoshua Sjoding2016-02-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | Instead of returning a channel of files, Tree.Files() now returns a FileIter with these qualities: * It returns files in the original order of the repository (relying on a * new Tree.OrderedNames property) * It can return errors encountered when retrieving files and trees from * underlying storage * It can be Closed without having to drain the entire channel * It defers the heavy lifting to a new TreeWalker type * Its behavior is a little more consistent with other Iter types * It's a little less prone to memory leaks This update includes a new TreeWalker type that will iterate through all of the entries of a tree and its descendant subtrees. It does the dirty work that Tree.walkEntries() used to do, but with a public API. A new TreeIter type is also included that just walks through subtrees. This could be useful for performing a directory search while ignoring files/blobs altogether.
* update imports to v3Máximo Cuadros2016-02-171-2/+2
|
* fix zlib invalid header errorAlberto Cortés2016-01-271-0/+68
| | | | | The return value of reads to the packfile were being ignored, so zlib was getting invalid data on it read buffers.
* Fix commit.File() gorutine leakAlberto Cortés2016-01-211-0/+134
Commit.File() was leaking a goroutine because it was looping over an iterator without closing its channel. Now commit.File() calls the new Tree.File() method that searches the file in the repository by trasversing the dir tree instead of using the tree.Files() iterator. This not only prevent the goroutine leak, but also speeds up file searching.