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.
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()
andspawnStream()
try to set the locale toen_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.
Fixes #507