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

Fix return type for Reference.isHead (typed as boolean, but returns a number) #1498

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dsabanin
Copy link

Both API docs and TypeScript typings say that Reference.isHead returns boolean, while in fact it's just a wrapper around Branch.isHead that returns 0 for false, 1 for true.

This change makes the code do what published API already says it does. Branch.isHead is correctly typed in API as returning number.

… number)

Both API docs and TypeScript typings say that Reference.isHead returns boolean, while in fact it's just a wrapper around Branch.isHead that returns 0 for false, 1 for true. 

This change makes the code do what published API already says it does. Branch.isHead is correctly typed in API as returning number.
@rcjsuen
Copy link
Member

rcjsuen commented May 18, 2018

I wonder if it might make more sense to change Branch.isHead to return true or false so that it's more intuitive instead of letting it return 0 or 1...

@dsabanin
Copy link
Author

dsabanin commented May 18, 2018

I agree, but I'm not sure what the policy on API changes is. The Branch.isHead is behaving according to the published API, which has it as returning number.

@rcjsuen
Copy link
Member

rcjsuen commented May 18, 2018

@dsabanin For better or worse, we've changed API before. ;) Many functions have changed from synchronous to being asynchronous.

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.

None yet

2 participants