Fix bug in isValidRemoteName by alehed · Pull Request #666 · libgit2/objective-git

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

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.

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

Reviewers

@tiennou tiennou tiennou requested changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@alehed @tiennou