Repository navigation
Closed
Labels
tech-debtIssues and pull requests related to addressing technical debt or improving the codebase
Description
In PRs #5299 and #5298 we were hoping to use expectedErrors to make it clear that we were handling errors, but an upstream change in Git meant the regex we were using was not valid.
This means we needed to upgrade dugite to 1.69.0 to get this corrected regex, but dugite is already running Git 2.18.0, so we need some further testing of the app to ensure no other regexes are affected (as well as our other Git operations).
These two code segments need to be updated:
desktop/app/src/lib/git/remote.ts
Lines 10 to 15 in db66b29
| // TODO: use expectedErrors here to handle a specific error | |
| // see https://github.com/desktop/desktop/pull/5299#discussion_r206603442 for | |
| // discussion about what needs to change | |
| const result = await git(['remote', '-v'], repository.path, 'getRemotes', { | |
| successExitCodes: new Set([0, 128]), | |
| }) |
desktop/app/src/lib/git/for-each-ref.ts
Lines 41 to 49 in db66b29
| // TODO: use expectedErrors here to handle a specific error | |
| // see https://github.com/desktop/desktop/pull/5299#discussion_r206603442 for | |
| // discussion about what needs to change | |
| const result = await git( | |
| ['for-each-ref', `--format=${format}`, ...prefixes], | |
| repository.path, | |
| 'getBranches', | |
| { successExitCodes: new Set([0, 128]) } | |
| ) |
And this is the example from the linked PR about what they should be changed to:
...
'getBranches',
expectedErrors: new Set([GitError.NotAGitRepository]),
})
if (result.gitError === GitError.NotAGitRepository) {
return []
}
Activity