Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly swallow errors if deleting a remote fails (#505)
`deleteRemote()` intends to return successfully if the to-be-deleted remote does not exist. In this case, git returns an exit code of 2, and outputs a message to stderr. Depending on the locale of the user's system, this error message might be localized. `spawnPromise()` and `spawnStream()` try to set the locale to `en_US`, but there are no guarantees that this locale is actually available on the user's system. Instead of doing fragile locale-dependent string parsing, simply use the exit code we get from git in this case and act on that. Fix the mocks in the tests to behave like the real-world git, and add a test for the non-English case as well. Co-authored-by: Søren Louv-Jansen <sorenlouv@gmail.com>
- Loading branch information