aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #739 from mcuadros/addMáximo Cuadros2018-02-283-0/+255
|\ | | | | new methods Worktree.[AddGlob|RemoveBlob] and recursive Worktree.[Add|Remove]
| * plumbing: format index, Index.Add and Index.Glob methodsMáximo Cuadros2018-02-263-0/+255
| | | | | | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* | Return error when creating public keys from invalid PEMMark DeLillo2018-02-252-0/+9
| | | | | | | | | | | | * pem.Decode will return nil in this case, and passing that to x509.IsEncryptedBlock will cause it to panic Signed-off-by: Mark DeLillo <github.med@delillo.org>
* | Merge pull request #749 from irias/masterv4.1.1Máximo Cuadros2018-02-172-2/+43
|\ \ | | | | | | plumbing: diff, fix crash when a small ending equal-chunk
| * | add test for crashing diffMechiel Lukkien2018-02-161-0/+37
| | | | | | | | | | | | | | | | | | | | | this reuses an existing patch, setting context to 6 triggers the bug, becuase of a 5-line trailing equals chunk. Signed-off-by: Mechiel Lukkien <mechiel@ueber.net>
| * | fix crash when generating a unified diff with a small ending equal-chunkMechiel Lukkien2018-02-141-2/+6
| | | | | | | | | | | | Signed-off-by: Mechiel Lukkien <mechiel@ueber.net>
* | | Merge pull request #751 from mcuadros/redirectMáximo Cuadros2018-02-154-10/+56
|\ \ \ | |/ / |/| | transport: http, fix services redirecting only info/refs
| * | transport: http, fix services redirecting only info/refsMáximo Cuadros2018-02-144-10/+56
| |/ | | | | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* | plumbing: format/packfile, add SaveOriginalMetadata functionJavi Fontan2018-02-092-5/+9
| | | | | | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
* | plumbing: format/packfile, fix panic retrieving object hash.Javi Fontan2018-02-093-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some cases the original data is not saved before it is cleaned and forces a panic when it's needed. The change adds ObjectToPack.CleanOriginal to be used to clean original object instead of: object.Original = nil Now when the Original data is freed because it's no longer in the pack window a SetOriginal call is done to make sure that Size, Hash and Size data is not lost. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* | Fix mistypingDmitry Labutin2018-02-071-2/+2
|/ | | | Signed-off-by: Dmitry Labutin <dmitry@labutin.com>
* Merge pull request #731 from jfontan/fix/crash-with-delta-cyclesMáximo Cuadros2018-01-264-2/+56
|\ | | | | plumbing: format/packfile, fix crash with cycle deltas
| * plumbing: format/packfile, check nil objects in ObjectToPackJavi Fontan2018-01-252-8/+12
| | | | | | | | | | | | | | SetOriginal now skips setting resolved values if the provided object is nil. BackToOriginal also skips nil Original objects. Signed-off-by: Javi Fontan <jfontan@gmail.com>
| * plumbing: format/packfile, fix crash with cycle deltasJavi Fontan2018-01-244-1/+51
| | | | | | | | | | | | | | | | | | | | | | | | Resolving cycles relied on ObjectToPack objects having Original. This is no longer true with the changes from #720. This commit changes: * Save original type, hash and size in ObjectToPack * Use SetObject to set both Original and resolved type, hash and size * Restore original object before using BackToOriginal (cycle resolution) * Update encoder test to check this case Signed-off-by: Javi Fontan <jfontan@gmail.com>
* | gofmt -sMáximo Cuadros2018-01-251-2/+2
|/ | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* plumbing: packfile, Add crc check to scanner test.Javi Fontan2018-01-211-4/+75
| | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
* plumbing: packfile, Add a buffer to crc writer.Javi Fontan2018-01-211-9/+31
| | | | | | | | | | | crc update with block smaller than 16 bytes uses a slower version of the function. ReadByte is heavily used by zlib inflate so most of the time crc is update byte by byte. A new Flush method is added to the scanner to flush this crc writer cache. It is only called when the Scanner reader is a teeReader. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* Test eviction of more than one objectJavi Fontan2018-01-161-0/+20
| | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
* Cache should hold objects the same size as MaxSizeJavi Fontan2018-01-161-1/+1
| | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
* Modify cache to delete more than one item to free spaceJavi Fontan2018-01-162-5/+3
| | | | | | | | | | | The previous version could only delete the oldest used object. If the object to cache was bigger than the space freed it could not be added. Also the decoder adds bases to the cache when they are needed. This change increases the speed creating indexes 2x. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* Clean reconstructed objects outside pack windowJavi Fontan2018-01-111-13/+19
| | | | | | | | | | | Object walk reconstructs delta objects but these are not cleaned up after they got out the pack window. Without this change all reconstructed objects reside in memory. restoreOriginal call is moved before calling Size(). Now we can not guarantee that the object is already undeltified. Signed-off-by: Javi Fontan <javier@sourced.tech>
* fix typoWells Johnston2018-01-081-1/+1
|
* Merge pull request #698 from jfontan/improvement/use-decoder-cacheMáximo Cuadros2017-12-205-58/+106
|\ | | | | plumbing: cache, enforce the use of cache in packfile decoder
| * Exercise NewObjectLRUDefault in testingJavi Fontan2017-12-201-41/+60
| | | | | | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
| * Make DeltaBaseCache privateJavi Fontan2017-12-201-6/+13
| | | | | | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
| * Fix typo and documentation of NewDecoderForTypeJavi Fontan2017-12-201-3/+3
| | | | | | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
| * Enforce the use of cache in packfile decoderJavi Fontan2017-12-204-12/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Improve delta reutilizationAntonio Jesus Navarro Perez2017-12-205-29/+152
|/ | | | | | | | | | | - Remove wrong 'if' on delta selector that causes poor delta reutilizations - packfile.Encoder now can write deltas and objects in a non specific order - ObjectToPack now saves the Offset on the packfile to be able to obtain base offset in a recursive manner and write them before the delta itself - Added encoder test to check cyclic delta chains - Check the output packfile hash in all encoder tests Signed-off-by: Antonio Jesus Navarro Perez <antnavper@gmail.com>
* plumbing: transport ssh, ssh_config implementationMáximo Cuadros2017-12-112-12/+107
| | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* check .ssh/config for host and port overrides; fixes #629Robert Smith2017-12-091-0/+15
|
* format: diff, remove error when two files are empty, submodules are simply ↵Máximo Cuadros2017-12-072-5/+2
| | | | | | ignored Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* object: patch, test patch on submodulesMáximo Cuadros2017-12-071-0/+44
|
* Ignore empty patches when calculating stats (fixes #654)Alexandr Krylovskiy2017-12-041-0/+5
|
* Fix revision solver for branch and tag (#660)Anthony HAMON2017-12-011-3/+3
| | | fix Repository.ResolveRevision for branch and tag
* Merge pull request #672 from ferhatelmas/gofmt-sMáximo Cuadros2017-12-0110-10/+10
|\ | | | | all: gofmt -s
| * all: gofmt -sferhat elmas2017-11-3010-10/+10
| |
* | storer: separate loose and packed object mgmt into optional ifacesJeremy Stribling2017-11-292-36/+25
| | | | | | | | Suggested by mcuadros.
* | plumbing: add `HasEncodedObject` method to StorerJeremy Stribling2017-11-291-0/+9
| | | | | | | | | | | | | | 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-292-2/+7
| |
* | Support for repacking objectsTaru Karttunen2017-11-292-0/+9
| |
* | Address CI and move code aroundTaru Karttunen2017-11-291-2/+4
| |
* | First pass of prune designTaru Karttunen2017-11-292-0/+27
| |
* | filesystem: implement PackRefs()Jeremy Stribling2017-11-291-0/+2
|/ | | | | | | | | | 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-2915-71/+29
| | | | | | | | | | - 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-281-0/+4
|
* Use optionally locking when updating refsTaru Karttunen2017-11-271-0/+1
|
* plumbing/transport: Fix truncated comment in EndpointOri Rawlings2017-11-271-1/+1
|
* all: fixes for ineffective assignferhat elmas2017-11-261-0/+1
|
* plumbing: object/{commit,tag}, encode method with sig optionalSunny2017-11-242-11/+14
| | | | | Adds Commit.encode() and Tag.encode() with optional `includeSig` parameter to include or exclude signature from the encoded object.
* plumbing: object/tag, add signature verificationSunny2017-11-242-0/+94
|