Skip to content

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.

dsabanin added 2 commits May 17, 2018 13:45
… 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.

2 participants