-
Notifications
You must be signed in to change notification settings - Fork 147
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
Combine Brach and Tag Options #153
Comments
For references we could possible include another field inside the Options struct that is a boolean for determining whether or not the |
Exactly. These options are duplicated likely. It seems a good idea. @DataDavD |
Ok great I'll start on it. Can you please assign me to this issue |
This commit refactors the existing RepositoryBranchTarget and RepositoryTagTarget types to a single RepositoryRefTarget since tags and branches are both refs and the two Target variables represented the same type anyways. This will also help us move to removing branch and tag specific options types into a single refs options type. See ktrysmt#155 and ktrysmt#153 (comment)
This commit refactors the existing RepositoryBranchTarget and RepositoryTagTarget types to a single RepositoryRefTarget since tags and branches are both refs and the two Target variables represented the same type anyways. This will also help us move to removing branch and tag specific options types into a single refs options type. See ktrysmt#155 and ktrysmt#153 (comment)
Currently Branches and Tags have separate Options structs although they are essentially the same endpoint. RepoBranchesOptions is only different from RepoTagsOptions in that it possess a
BranchName
field as shown herego-bitbucket/bitbucket.go
Lines 202 to 211 in dd20750
and
go-bitbucket/bitbucket.go
Lines 224 to 232 in dd20750
I propose that we combine the repo branches and tag option structs into a single
RepositoryRefOptions
(branches and tags are both refs anyways) and instead of aBranchName
field just have aName
field that represents either the branch name or tag name. This would allow us to have a singleListRefs
function instead of two separate functions for listing branches and listing tags. That way users can use the same options struct to access a single function for listing refs (i.e. branches or tags) and it can make use of the existing GetBranch function to also get a tag.So, @ktrysmt If this proposal is acceptable and you agree, can you assign me to do this refactor please. For context, I've already started working on this for fun in my fork.
Thanks in advance.
Best,
dd
The text was updated successfully, but these errors were encountered: