aboutsummaryrefslogtreecommitdiffstats
path: root/formats/packfile
Commit message (Collapse)AuthorAgeFilesLines
* Renamed internal close function to checkCloseJoshua Sjoding2016-02-272-9/+9
| | | | * Old name accidentally shadowed builtin close function
* Refactor to use core.ObjectReader and core.ObjectWriterJoshua Sjoding2016-02-252-10/+74
| | | | | | | | | | | | * New function signatures provide the necessary interface to stream data from disk when using filesystem-based storage in the future * New function signatures provide proper error handling * ObjectReader and ObjectWriter interfaces added to avoid future refactoring, currently are type aliases for io.ReadCloser and io.WriteCloser respectively * Object.Reader now returns (ObjectReader, error) * Object.Writer now returns (ObjectWriter, error) * File.Contents now returns (string, error) * File.Lines now returns ([]string, error) * Blob.Reader now returns (core.ObjectReader, error) * Added internal close helper function for deferred calls to Close that need to check the return value
* New iteration behavior via FileIter and TreeWalkerJoshua Sjoding2016-02-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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-172-3/+3
|
* storages: memory objectMáximo Cuadros2016-02-172-7/+8
|
* Functions in core.ObjectStorage interface now return an errorJoshua Sjoding2016-02-162-8/+13
|
* fix zlib invalid header errorAlberto Cortés2016-01-271-3/+2
| | | | | The return value of reads to the packfile were being ignored, so zlib was getting invalid data on it read buffers.
* Speed up packfile readingAlberto Cortés2016-01-262-1/+8
| | | | | By adding a bufio to the trackingReader, otherwise most of the time is spent in syscalls for small reads to the packfile.
* internal -> coreMáximo Cuadros2015-10-312-21/+21
|
* objects: using readers from internal.ObjectMáximo Cuadros2015-10-262-21/+21
|
* formats/packfile: new reader APIMáximo Cuadros2015-10-259-669/+161
|
* formats/packfile: new reader API (wip)Máximo Cuadros2015-10-254-142/+207
|
* formats/packfile: new reader API (wip)Máximo Cuadros2015-10-254-176/+128
|
* formats/packfile: test improvementsMáximo Cuadros2015-10-253-11/+128
|
* formats/packfile: cleanupMáximo Cuadros2015-10-236-99/+166
|
* formats/packfile: type Hash instead of stringsMáximo Cuadros2015-10-237-0/+1104