Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upMake index methods async #971
Conversation
|
Also updated the examples to both use the async methods and remove the double reading of the index. |
|
|
|
We need to start using async/await internally. ^_^ |
|
#874 |
| "isErrorCode": true | ||
| } | ||
| }, | ||
| "git_index_conflict_remove": { |
This comment has been minimized.
This comment has been minimized.
srajko
Apr 8, 2016
Collaborator
If you want to be pedantic about keeping things sorted alphabetically, this one belongs a few entries down
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.

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

johnhaley81 commentedMar 26, 2016
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