Repository navigation
Prevent saving of disallowed character strings for user's name and email - #3590
Merged
Merged
Conversation
Replicates rules according to git's identity rules in: https://github.com/git/git/blob/e629a7d28a405e48fae6b064a781a10e885159fc/ident.c#L191-L203
- Provides dialog error message with disallowed string - Disables save
iAmWillShepherd
suggested changes
Dec 12, 2017
| const disallowedNameCharacters = disallowedCharacters(name) | ||
| const disallowedEmailCharacters = disallowedCharacters(email) | ||
|
|
||
| if (disallowedNameCharacters) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| return `Git name field cannot be a disallowed character "${ | ||
| disallowedNameCharacters | ||
| }"` | ||
| } else if (disallowedEmailCharacters) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| return `Git email field cannot be a disallowed character "${ | ||
| disallowedEmailCharacters | ||
| }"` | ||
| } else { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| } | ||
|
|
||
| private renderDisallowedCharactersError(message: string | null) { | ||
| if (message) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Contributor
|
Check #3538 for additional context on of my re-invigorated hatred of JS truthiness[es]. |
Truthiness isn't enough! Explicitness is queen.
New prettify rules ftw
Contributor
Author
iAmWillShepherd
approved these changes
Dec 13, 2017
Contributor
|
Works on my machine and yours, let's hope it works on everyone else's 😆 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #3204
Valid name/email:

Invalid name (with valid email):

Invalid email (with valid name):

Invalid name + email will show an error message for the name only; when the name is resolved, it will surface the dialog error message for an invalid email.