| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
The function was originally synchronous which meant it would return something on regardless of whether it succeeded (a branch) or failed (an error code). This forces the client to have to check whether the returned object is an error code or an object. Change the function to be asynchronous instead so that clients can use the resolved or rejected promise to easily determine whether the branch was successfully created or not.
move lookup createFromAnnotated
|
I realized that the error was due to the function being synchronous and always returning something regardless of whether the function succeeded or failed. This caused the then(*) function to be called even though it had actually failed (which then caused the test to fail). Changing the function to be asynchronous now gets the test to pass successfully. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Note that the test for createFromAnnotated is failing for me. It seems like the branch is being created even when the force flag has not been set. I would have expected the conflict in the branch's name to prevent the tag from being created but that's not happening.
The returned annotated commit does have the correct SHA-1 hash so that is not the issue. The branch that gets returned by the promise from createFromAnnotated has the same SHA-1 hash as what it was originally pointing at (ergo, the master commit) so it's almost as if the function call never happened! 🤔