Make index methods async#971
Merged
johnhaley81 merged 6 commits intomasternodegit/nodegit:masterfrom Apr 11, 2016
Merged
Conversation
Collaborator
Author
|
Also updated the examples to both use the async methods and remove the double reading of the index. |
36f0f1c to
60c84f8
Compare
Collaborator
|
💖 |
Collaborator
Author
Member
|
We need to start using async/await internally. ^_^ |
Collaborator
Author
|
#874 😄 |
generate/input/descriptor.json
Outdated
| "isErrorCode": true | ||
| } | ||
| }, | ||
| "git_index_conflict_remove": { |
Collaborator
There was a problem hiding this comment.
If you want to be pedantic about keeping things sorted alphabetically, this one belongs a few entries down
added 6 commits
April 8, 2016 16:06
Anytime the index reads/writes to the disk it should be non-blocking. Additionally this will give us thread safety protection since async methods are piped through the `LockManager`
So this test was never valid ¯\_(ツ)_/¯ You can't call `Index#addByPath` with an absolute path which was what was happening. Since the method was sync the result was considered the actual result of the call and not the error code so this error was never caught. Now that the function is async, that result is correctly interpretted and the test failed correctly. Changing this test to use the relative path fixes the test.
Writing an index to disk is now async and no longer returns it's result code. Instead of checking for `0` we can just handle the error callback/rejected promise case.
This was referenced Apr 8, 2016
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.
Anytime the index reads/writes to the disk it should be non-blocking. Additionally this will give us thread safety protection since async methods are piped through the
LockManager