Create RepositoryRefsOptions and ListRefs method with helper funcs #155
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.
TL;DR: this PR creates a RepositoryRefsOptions type and starts the groundwork to eventually remove RepositoryBranchOptions and RepositoryTagOptions and those methods that relies on these types.
This PR creates a RepositoryRefsOptions and a ListRefs method on the Repository type. This new refs type will allow users to specific their refs options once and be able to operate on all kinds of refs (i.e. tags and branches) without specifying 2 separate options. Right now, users have to specify a RepositoryBranchOptions and RepositoryTagOptions in order to call ListBranches and ListTags.
This current iteration of the code doesn't adhere to the fact that git refers to all branches and tags as refs and this is reflected in the Bitbucket API since both tags and branches endpoints are build off of the refs endpoint.
I want to add a test for this new ListRefs function, but in the meantime I wanted to create this PR s that we could discuss future plans. Currently, I think it is best to keep Refs options alongside the branches and tags options since if we remove those 2 option types then it imparts a breaking change on users. So we should slowly move towards removing those option types and their methods instead removing support all at once and making a bunch of breaking changes.
Once we have built out the same functionality for branches and tags build upon the refs options type then we can move to completely remove the branches and tags options types and release for a breaking change.