aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/object_test.go
Commit message (Collapse)AuthorAgeFilesLines
* *: Remove use of deprecated io/utilPaulo Gomes2023-05-111-2/+1
| | | | Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* storage: filesystem, Populate index before use. Fixes #148Arieh Schneier2023-05-041-0/+15
| | | | Signed-off-by: Arieh Schneier <15041913+AriehSchneier@users.noreply.github.com>
* Merge pull request #418 from abhinav/unusedMáximo Cuadros2021-12-101-1/+1
|\ | | | | Remove unused vars/types/funcs/fields
| * Remove unused variables/types/functionsAbhinav Gupta2021-11-271-1/+1
| | | | | | | | | | | | | | | | [staticcheck](https://staticcheck.io/) reported a number of unused fields, functions, types, and variables across the code. Where possible, use them (assert unchecked errors in tests, for example) and otherwise remove them.
* | storage: filesystem, switch from os.SEEK_* to io.Seek* (#421)Abhinav Gupta2021-12-101-2/+2
|/ | | | | | | The `os.SEEK_*` constants have been deprecated since Go 1.7. It is now recommended to use the equivalent `io.Seek*` constants. Switch `os.SEEK_CUR` to `io.SeekCurrent`, and `os.SEEK_SET` to `io.SeekStart`.
* plumbing: format/packfile, prevent large objects from being read into memory ↵zeripath2021-06-301-4/+59
| | | | | | | | | | | | | | | completely (#330) This PR adds code to prevent large objects from being read into memory from packfiles or the filesystem. Objects greater than 1Mb are now no longer directly stored in the cache or read completely into memory. This PR differs and improves the previous broken #323 by fixing several bugs in the reader and transparently wrapping ReaderAt as a Reader. Signed-off-by: Andrew Thornton <art27@cantab.net>
* *: use go-billy instead of os callsMáximo Cuadros2021-05-021-3/+5
|
* Support partial hashes in Repository.ResolveRevision.David Symonds2020-07-161-0/+17
| | | | | | | | | | | | | Like `git rev-parse <prefix>`, this enumerates the hashes of objects with the given prefix and adds them to the list of candidates for resolution. This has an exhaustive slow path, which requires enumerating all objects and filtering each one, but also a couple of fast paths for common cases. There's room for future work to make this faster; TODOs have been left for that. Fixes #135.
* ci: based on github actionsv5.0.0Máximo Cuadros2020-03-151-15/+3
|
* *: migration from go-git-fixtures/v4 and go-git/gcfgMáximo Cuadros2020-03-101-14/+2
|
* *: migration from gopkg to go modulesMáximo Cuadros2020-03-101-3/+3
|
* filesystem: ObjectStorage, MaxOpenDescriptors optionArran Walker2019-04-221-0/+18
| | | | | | | | The MaxOpenDescriptors option provides a middle ground solution between keeping all packfiles open (as offered by the KeepDescriptors option) and keeping none open. Signed-off-by: Arran Walker <arran.walker@fiveturns.org>
* storage/filesystem: check file object before using cacheJavi Fontan2019-01-301-0/+17
| | | | | | | | | | If the cache is shared between several repositories getFromUnpacked can erroneously return an object from other repository. This decreases performance a little bit as there's an extra fs operation when the object is in the cache but is correct when the cache is shared. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* storage/filesystem: Added reindex method to reindex packfilesJavier Peletier2018-11-121-0/+56
| | | | Signed-off-by: Javier Peletier <jm@epiclabs.io>
* filesystem: add a new test for EncodedObjectSizeJeremy Stribling2018-10-121-0/+14
| | | | | | Suggested by taruti. Signed-off-by: Jeremy Stribling <strib@alum.mit.edu>
* object: get object size without reading whole objectJeremy Stribling2018-10-111-0/+24
| | | | Signed-off-by: Jeremy Stribling <strib@alum.mit.edu>
* storage/filesystem: keep packs open in PackfileIterJavi Fontan2018-09-201-4/+40
| | | | | | | | PackfileIter was not taking into account the option KeepDescriptors and was always closing the file. This caused "file already closed" errors when iterating packfiles in with KeepDescriptors active. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* Expose Storage cache.kuba--2018-09-071-17/+8
| | | | Signed-off-by: kuba-- <kuba@sourced.tech>
* storage/filesystem: compare files using offset in testJavi Fontan2018-09-061-1/+7
| | | | | | | | Using equals to compare files it uses diff to do so. This can potentially consume lots of ram. Changed the comparison to use file offsets. If the descriptor is reused the offset is maintained. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* storage/filesystem: add KeepDescriptors testJavi Fontan2018-09-051-0/+31
| | | | | | Also delete Close from MockObjectStorage and memory storer. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* plumbing: packfile, open and close packfile on FSObject readsMiguel Molina2018-08-091-3/+37
| | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* storage: filesystem, add PackfileIter benchmark reading object contentMiguel Molina2018-08-091-0/+67
| | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* storage: filesystem, benchmark PackfileIterMiguel Molina2018-08-091-11/+68
| | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* *: use parser to populate non writable storages and bug fixesMiguel Molina2018-08-071-1/+5
| | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* storage: filesystem, make ObjectStorage constructor publicMiguel Molina2018-06-081-5/+5
| | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* dotgit: Move package outside internal.Antonio Jesus Navarro Perez2018-06-051-1/+1
| | | | Signed-off-by: Antonio Jesus Navarro Perez <antnavper@gmail.com>
* update to go-billy.v4 and go-git-fixtures.v3Máximo Cuadros2017-11-231-1/+1
| | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* storage: reuse deltas from packfilesSantiago M. Mola2017-07-271-2/+2
| | | | | | | | | | | | | | | | | | | * plumbing: add DeltaObject interface for EncodedObjects that are deltas and hold additional information about them, such as the hash of the base object. * plumbing/storer: add DeltaObjectStorer interface for object storers that can return DeltaObject. Note that calls to EncodedObject will never return instances of DeltaObject. That requires explicit calls to DeltaObject. * storage/filesystem: implement DeltaObjectStorer interface. * plumbing/packfile: packfile encoder now supports reusing deltas that are already computed (e.g. from an existing packfile) if the storage implements DeltaObjectStorer. Reusing deltas boosts performance of packfile generation (e.g. on push).
* project: move imports from srcd.works to gopkg.inAntonio Jesus Navarro Perez2017-03-071-2/+2
| | | | To be able to fix #261 we will move again to gopkg.in before v4 stable release.
* new srcd.works/go-git.v4 pathMáximo Cuadros2017-01-301-2/+2
|
* new git fixture pathMáximo Cuadros2017-01-301-1/+1
|
* packfile/decoder: speed up packfile iterator when specific type (#200)Antonio Navarro Perez2017-01-121-11/+48
|
* move plumbing from top level package to plumbing (#183)Santiago M. Mola2016-12-141-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * plumbing: rename Object -> EncodedObject. * plumbing/storer: rename ObjectStorer -> EncodedObjectStorer. * move difftree to plumbing/difftree. * move diff -> utils/diff * make Object/Tag/Blob/Tree/Commit/File depend on storer. * Object and its implementations now depend only on storer.EncodedObjectStorer, not git.Repository. * Tests are decoupled accordingly. * move Object/Commit/File/Tag/Tree to plumbing/object. * move Object/Commit/File/Tag/Tree to plumbing/object. * move checkClose to utils/ioutil. * move RevListObjects to plumbing/revlist.Objects. * move DiffTree to plumbing/difftree package. * rename files with plural nouns to singular * plumbing/object: add GetBlob/GetCommit/GetTag/GetTree.
* new plumbing package (#118)Máximo Cuadros2016-11-081-12/+12
| | | * plumbing: now core was renamed to core, and formats and clients moved inside
* global storage interface refactor (#112)Máximo Cuadros2016-11-071-4/+4
| | | | | | | | | | | * core: ObjectStorage, ReferenceStorage renamed to ObjectStorer and ReferenceStorer * rebase * general, changes request by @alcortes * general, changes request by @alcortes
* fix fixtures usageMáximo Cuadros2016-10-261-1/+1
|
* fixtures: new fixture package being use in all packagesMáximo Cuadros2016-09-121-5/+3
|
* format: packfile fix ReadObjectAt without decodeMáximo Cuadros2016-09-111-9/+11
|
* storage: filesystem iter implementationMáximo Cuadros2016-09-091-0/+38
|
* storage: filessytem read multiple packfiles support and index decodingMáximo Cuadros2016-09-091-312/+27
|
* format: packfile new interfaceMáximo Cuadros2016-09-071-7/+7
|
* storage: filesystem idx generation (wip)Máximo Cuadros2016-09-061-19/+23
|
* core: ObjectStorage.WriterMáximo Cuadros2016-09-051-0/+17
|
* core: ObjectStorage.Begin and TxObjectStorageMáximo Cuadros2016-09-051-4/+4
|
* core: Storage.Get, switch order of argsMáximo Cuadros2016-08-291-2/+2
|
* storage: Add object type hint parameter to ObjectStorage.Get. (#69)Santiago M. Mola2016-08-291-4/+6
| | | | | | | Some storage backends can optimize object lookup if they get the object type that is expected. So we the signature of the Get method is now Get(Hash, ObjectType). Added generic tests for storage backends.
* storage/filesystem: ConfigStore implementationMáximo Cuadros2016-08-211-8/+9
|
* core: Storage, removing err returning *StoragesMáximo Cuadros2016-08-141-4/+1
|
* core: removing Object.Content, the Reader should be used alwaysMáximo Cuadros2016-08-141-2/+6
|
* storage: Storage entity support, and DotGit support for ReferencesMáximo Cuadros2016-08-121-0/+315