Check parameters before performing reset#1603
Merged
Merged
Conversation
If a promise is passed down to the native C++ layer, v8 will crash. To ensure that this does not happen, a check will be performed in the JavaScript layer to verify that the repository is the same as the repository of the commit object. While logically the commit of one repository instance is the same as a commit of another repository instance (if they point to the same .git folder), programmatically they are not equivalent as a check is done on libgit2's side to ensure that they come from the same thing. As a result, the check on the JavaScript side purely compares the pointers over some other logical piece of information (such as its path or working directory). Signed-off-by: Remy Suen <remy.suen@gmail.com>
Member
Author
|
Thanks for reviewing and merging, @implausible! |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
If a promise is passed down to the native C++ layer, v8 will crash. To ensure that this does not happen, a check will be performed in the JavaScript layer to verify that the repository is the same as the repository of the commit object.
While logically the commit of one repository instance is the same as a commit of another repository instance (if they point to the same
.gitfolder), programmatically they are not equivalent as a check is doneon libgit2's side to ensure that they come from the same thing. As a result, the check on the JavaScript side purely compares the pointers over some other logical piece of information (such as its path or working directory).
This is not a general fix for #1127 but is simply meant to help the case of #1596. I have not put much thought into it but perhaps the generator could be changed so that at least
RepositoryandCommitobjects could be verified?