Repository navigation
Conversation
An error in GitHub Desktop was being thrown that was not being appropriately parsed. In order to properly catch it a new regular expression pattern has been added.
An exra regular expression pattern was added to detect a Git.HostDown error. In order to make sure it is parsing correctly a test has been added.
shiftkey
left a comment
There was a problem hiding this comment.
Just one thing to ensure the test handles what Git emits
| }) | ||
|
|
||
| it('can parse the could not resolve host error', () => { | ||
| const stderr = `"Cloning into '/cloneablepath/'... fatal: unable to access 'https://github.com/Daniel-McCarthy/dugite.git/': Could not resolve host: github.com"` |
There was a problem hiding this comment.
Are you able to include the newline characters in this stderr output so we can confirm the regex is working as expected?
There was a problem hiding this comment.
Ah yes, good catch! I have updated both as appropriate.
Previously the test and regex were missing the "↵" newline characters where appropriate. They have been added to match the original error's placement of new line characters.
…r newline Previously a commit was added to properly handle newline characters. The characters used however are not newline escape characters. They have been updated to fix the previous issue.
Because this is an additive regex I'm fine to leave it as-is. |
shiftkey
left a comment
There was a problem hiding this comment.
This is pretty close to merging. One suggestion to relax the new regex...
Detecting the final newline character is not essential for the match to be made, therefore we can safely remove it. Co-Authored-By: Daniel-McCarthy <[email protected]>
|
|
|
@shiftkey That's awesome, thank you! I will definitely be keeping that in mind. |
This pull request is made to assist Desktop's Issue #926 by adding a regex pattern to detect a cloning failure error. Currently the error is not being parsed due to not having a pattern that matches to it. The error in question occurs when attempting to clone a repository with no available internet connection.
The exact error to be detected is:
"Cloning into '/home/hellokitty/Documents/GitHub/Chixel'... fatal: unable to access 'https://github.com/Daniel-McCarthy/Chixel.git/': Could not resolve host: github.com"In a comment it was suggested that this regular expression pattern should be added to target the same error type
HostDownthat is being used by a currently existing regex pattern. I have added a test to go along with checking the new regular expression pattern is parsing properly. However, I noticed there was not already one in place for the originalHostDownerror regex. I could add a test to go along with the original pattern as well in this pull request.