aboutsummaryrefslogtreecommitdiffstats
path: root/storage
Commit message (Collapse)AuthorAgeFilesLines
...
| * dotgit: add test for bad file in pack directoryJeremy Stribling2018-04-161-1/+13
| | | | | | | | | | | | | | Suggested by mcuadros. Issue: src-d/go-git#807 Signed-off-by: Jeremy Stribling <strib@alum.mit.edu>
| * dotgit: ignore filenames that don't match a hashJeremy Stribling2018-04-131-2/+10
| | | | | | | | | | | | | | For both packfiles and object files. Issue: keybase/client#11366 Signed-off-by: Jeremy Stribling <strib@alum.mit.edu>
* | storage: dotgit, init fixtures in benchmark. Fixes #770Javi Fontan2018-04-161-0/+1
|/ | | | | | | fixtures is not initialized in BenchmarkRefMultipleTimes and caused panic. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* storage: filesystem/dotgit, fix typo in return paramJavi Fontan2018-03-281-1/+1
| | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
* *: Use CheckClose with named returnsJavi Fontan2018-03-275-15/+15
| | | | | | | | Previously some close errors were losts. This is specially problematic in go-git as lots of work is done here like generating indexes and moving packfiles. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* storage/filesystem: optimize packfile iteratorDenys Smirnov2018-03-031-22/+61
| | | | | | | | * do not store extra bool values in the seen map * open packfile iterators lazily Signed-off-by: Denys Smirnov <denys@sourced.tech>
* all: remove some unused codeDaniel Martí2018-03-011-2/+0
| | | | Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
* storage/filesystem/shallow: fix error checkingferhat elmas2018-02-011-1/+1
| | | | Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
* gofmt -sMáximo Cuadros2018-01-251-1/+1
| | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* Merge pull request #700 from jfontan/improvement/support-non-rw-filesystemsMáximo Cuadros2018-01-026-33/+142
|\ | | | | Add a setRef and rewritePackedRefsWhileLocked versions that supports non rw fs
| * Add norwfs version of rewritePackedRefsWhileLockedJavi Fontan2017-12-224-4/+50
| | | | | | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
| * Check reference also in norwfs SetRefJavi Fontan2017-12-221-2/+25
| | | | | | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
| * Add comment to the norwfs version of SetRefJavi Fontan2017-12-211-0/+7
| | | | | | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
| * Add a setRef version that supports non rw fsJavi Fontan2017-12-213-29/+62
| | | | | | | | | | | | | | | | | | There are some filesystems that do not support opening the files in read and write modes at the same time. The method SetRef is split in files with an extra version that only writes the reference. It can be activated with -tags norwfs on building. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* | Make DeltaBaseCache privateJavi Fontan2017-12-201-6/+6
| | | | | | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
* | Enforce the use of cache in packfile decoderJavi Fontan2017-12-201-5/+2
|/ | | | | | | | | | | | | | | | | Decoder object can make use of an object cache to speed up processing. Previously the only way to specify it was changing manually the struct generated by NewDecodeForFile. This lead to some instances to be created without it and penalized performance. Now the cache should be explicitly passed to the constructor function. NewDecoder now creates objects with a cache using the default size. A new helper function was added to create cache objects with the default size as this becomes a common task now: cache.NewObjectLRUDefault() Signed-off-by: Javi Fontan <jfontan@gmail.com>
* *: simplicationferhat elmas2017-12-181-5/+1
| | | | | | - no unnecessary err/bool check, uses them directly Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
* storage: filesystem, add support for git alternates (#663)Sunny2017-12-063-1/+118
| | | | This change adds a new method Alternates() in DotGit to check and query alternate source.
* dotgit: use Equal method of time.Time for equalityferhat elmas2017-12-041-1/+1
|
* Merge pull request #672 from ferhatelmas/gofmt-sMáximo Cuadros2017-12-011-1/+1
|\ | | | | all: gofmt -s
| * all: gofmt -sferhat elmas2017-11-301-1/+1
| |
* | dotgit: rewrite packed-refs while holding lockJeremy Stribling2017-11-303-60/+103
| | | | | | | | | | | | Windows file system doesn't let us rename over a file while holding that file's lock, so use rewrite as a last resort. It could result in a partially-written file, if there's a failure at the wrong time.
* | dotgit: open+lock packed-refs file until it doesn't changeJeremy Stribling2017-11-291-18/+46
| | | | | | | | Windows doesn't like it when we re-open a file we already have locked.
* | storage: some minor code cleanupJeremy Stribling2017-11-292-8/+4
| | | | | | | | | | | | Suggested by mcuadros. Issue: #669
* | plumbing: add `HasEncodedObject` method to StorerJeremy Stribling2017-11-292-0/+34
| | | | | | | | | | | | | | This allows the user to check whether an object exists, without reading all the object data from storage. Issue: KBFS-2445
* | Make object repacking more configurableTaru Karttunen2017-11-293-6/+18
| |
* | Support for repacking objectsTaru Karttunen2017-11-293-13/+36
| |
* | First pass of prune designTaru Karttunen2017-11-293-10/+85
| |
* | dotgit: use bufio for PackRefsJeremy Stribling2017-11-291-10/+8
| | | | | | | | | | | | Suggested by taruti. Issue: #13
* | dotgit: during rewriting, re-open packed-refs after lockingJeremy Stribling2017-11-291-9/+21
| | | | | | | | | | | | The file could have been completely replaced while waiting for the lock, so we need to re-open, otherwise we might be reading a stale file that has already been deleted/overwritten.
* | filesystem: todo comment about "all" paramJeremy Stribling2017-11-291-0/+4
| | | | | | | | Issue: KBFS-2517
* | dotgit: fix up PackRefs comment for upstreamingJeremy Stribling2017-11-291-26/+8
| |
* | filesystem: implement PackRefs()Jeremy Stribling2017-11-294-0/+203
|/ | | | | | | | | | Currently this implementation is only valid for kbfsgit, since it assumes some things about the filesystem not being updated during the packing, and about conflict resolution rules. In the future, it would be nice to replace this with a more general one, and move this kbfsgit-optimized implementation into kbfsgit. Issue: KBFS-2517
* all: simplificationferhat elmas2017-11-293-16/+12
| | | | | | | | | | - no length for map initialization - don't check for boolean/error return - don't format string - use string method of bytes buffer instead of converting bytes to string - use `strings.Contains` instead of `strings.Index` - use `bytes.Equal` instead of `bytes.Compare`
* dotgit: add CheckAndSetReference testsJeremy Stribling2017-11-282-11/+27
|
* Merge remote-tracking branch 'src-d/master' into gh-fast-forward-fetchJeremy Stribling2017-11-282-6/+76
|\
| * dotgit: don't list references twiceJeremy Stribling2017-11-272-4/+20
| | | | | | | | Restore the `seen` map that avoided listing packed-refs twice.
| * dotgit: add a test for removing a ref from a file and packed-refsJeremy Stribling2017-11-271-0/+29
| |
| * dotgit: remove loose ref AND packed ref, if both existJeremy Stribling2017-11-271-3/+28
| | | | | | | | Issue: KBFS-2509
* | Document Lock+Close usageTaru Karttunen2017-11-271-0/+4
| |
* | Use optionally locking when updating refsTaru Karttunen2017-11-274-13/+76
|/
* all: fixes for ineffective assignferhat elmas2017-11-262-0/+2
|
* update to go-billy.v4 and go-git-fixtures.v3Máximo Cuadros2017-11-2310-16/+16
| | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* dotgit: remove ref cache for packed refsMiguel Molina2017-11-211-48/+29
| | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* dotgit: avoid duplicated references returned by RefsMiguel Molina2017-08-291-10/+15
| | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* dotgit: rewrite the way references are looked upMiguel Molina2017-08-262-24/+76
| | | | | | Now there's only two ways of getting a reference, by checking under refs/ directory or in packed-refs. refs/ directory is checked using a direct read by reference name and packed refs are cached until they have been changed. Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* prevent PackWriter from using Notify if nothing was writtenMiguel Molina2017-08-102-1/+22
| | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* Merge pull request #501 from smola/config-multiple-urlsMáximo Cuadros2017-08-022-4/+4
|\ | | | | config: multiple values in RemoteConfig (URLs and Fetch)
| * config: multiple values in RemoteConfig (URLs and Fetch)Santiago M. Mola2017-08-012-4/+4
| | | | | | | | | | | | | | | | * Change `URL string` to `URL []string` in `RemoteConfig`, since git allows multiple URLs per remote. See: http://marc.info/?l=git&m=116231242118202&w=2 * Fix marshalling of multiple fetch refspecs.
* | Merge pull request #515 from smola/reuse-packed-objectsMáximo Cuadros2017-07-275-9/+179
|\ \ | |/ |/| storage: reuse deltas from packfiles