-
Notifications
You must be signed in to change notification settings - Fork 360
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
Fix: Git package error handling #8345
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is of course cool, but also unpleasant. E.g. this code still breaks because
❯ LANGUAGE=sv git status
På grenen docs/getting-started-on-the-project
inget att checka in, arbetskatalogen ren
will happen in some places in Northern Europe.
Perhaps open an issue to discover a proper way to run Git plumbing?
case strings.Contains(lowerOut, "remote not found"): | ||
return "", errors.ErrRemoteNotFound | ||
default: | ||
return "", fmt.Errorf("%s: %w", out, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Odd: This error has a different format, it includes out
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only place where the output has any relevance
Opened #8348 |
Closes #8086
Change Description
Background
Parsing git shell commands response to classify into comprehensible errors, seems like some FS return different strings for the same errors.
Bug Fix
The bug resulted from difference in output when not a git repository
The fix was to lowercase the out put before comparison
Testing Details
Added unit test
Breaking Change?
No