Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swallow "remote not found" error on git before 2.30 #514

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

imphil
Copy link
Contributor

@imphil imphil commented Sep 23, 2024

Git 2.30.0 introduced a dedicated exit code (2) for when git remote rm
failed because the remote does not exist. Earlier versions of git
always returned code 128, and only parsing stderr could tell the error
conditions apart.

Support all versions of git by checking for both exit code 2, and exit
code 128 with the specific error message. The exit code 2 check remains
more robust against localized output, hence it's kept in addition to the
output parsing path that was removed in #505.

Fixes #509

Git 2.30.0 introduced a dedicated exit code (2) for when `git remote rm`
failed because the remote does not exist. Earlier versions of git
always returned code 128, and only parsing stderr could tell the error
conditions apart.

Support all versions of git by checking for both exit code 2, and exit
code 128 with the specific error message. The exit code 2 check remains
more robust against localized output, hence it's kept in addition to the
output parsing path that was removed in sorenlouv#505.

Fixes sorenlouv#509
@sorenlouv sorenlouv merged commit cd06965 into sorenlouv:main Sep 26, 2024
1 of 2 checks passed
@sorenlouv
Copy link
Owner

Published in v9.6.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SpawnError: No such remote on 9.6.0
2 participants