This repository was archived by the owner on Sep 11, 2020. It is now read-only.
plumbing: format/packfile, fix crash with cycle deltas#731
Merged
mcuadros merged 2 commits intosrc-d:masterfrom Jan 25, 2018
Merged
plumbing: format/packfile, fix crash with cycle deltas#731mcuadros merged 2 commits intosrc-d:masterfrom
mcuadros merged 2 commits intosrc-d:masterfrom
Conversation
Resolving cycles relied on ObjectToPack objects having Original. This is no longer true with the changes from src-d#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>
ajnavarro
previously requested changes
Jan 25, 2018
| // SetOriginal sets both Original and saves size, type and hash | ||
| func (o *ObjectToPack) SetOriginal(obj plumbing.EncodedObject) { | ||
| o.Original = obj | ||
| o.originalSize = obj.Size() |
Contributor
Author
There was a problem hiding this comment.
Added checks to SetOriginal and BackToOriginal. The test now also uses it to set Original to nil.
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>
mcuadros
approved these changes
Jan 25, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolving cycles relied on
ObjectToPackobjects having Original. This is no longer true with the changes from #720. This commit changes:ObjectToPackSetObjectto set both Original and resolved type, hash and sizeBackToOriginal(cycle resolution)