Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix bug in isValidRemoteName #666

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

Merged
merged 1 commit into from
Sep 10, 2018
Merged

Conversation

alehed
Copy link
Contributor

@alehed alehed commented Sep 8, 2018

According to the docs git_remote_is_valid_name returns either 1 (success) or 0.

@@ -104,7 +104,7 @@ - (NSString *)description {
+ (BOOL)isValidRemoteName:(NSString *)name {
NSParameterAssert(name != nil);

return git_remote_is_valid_name(name.UTF8String) == GIT_OK;
return git_remote_is_valid_name(name.UTF8String);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer return (git_remote_is_valid_name(name.UTF8String) == 1 ? YES : NO); so there's no chance of a -1 error being reported as "true", and we force-map to "BOOL"-compatible values.

According to the docs git_remote_is_valid_name returns either 1 (success) or 0.
@alehed
Copy link
Contributor Author

alehed commented Sep 10, 2018

Rebased and pushed

@tiennou
Copy link
Contributor

tiennou commented Sep 10, 2018

Perfect, thanks !

@tiennou tiennou merged commit 6fe2c65 into libgit2:master Sep 10, 2018
@tiennou tiennou mentioned this pull request Oct 27, 2018
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.

2 participants