-
Notifications
You must be signed in to change notification settings - Fork 151
Adds the ability to create forks #91
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you contribution. And I left some comments. Would you see these? @danielrs
go.mod
Outdated
|
|
||
| require ( | ||
| github.com/golang/protobuf v1.0.0 | ||
| github.com/golang/protobuf v1.0.0 // indirect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you remove the line if it is not a problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it
| //} | ||
| if ro.IsPrivate != "" { | ||
| body["is_private"] = ro.IsPrivate | ||
| body["is_private"] = strings.ToLower(strings.TrimSpace(ro.IsPrivate)) != "false" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the below was the right one, and do you think?
| body["is_private"] = strings.ToLower(strings.TrimSpace(ro.IsPrivate)) != "false" | |
| body["is_private"] = strings.ToLower(strings.TrimSpace(ro.IsPrivate)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ktrysmt Bitbucket expects a boolean value in the payload for the is_private field. If you try and submit a request with the previous code you get the error:
{"type": "error", "error": {"fields": {"is_private": "expected bool"}, "message": "Bad request"}}
The new condition of != makes the value a real boolean, which is what Bitbucket expects. Check the schema here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
I understood that is_private: boolean is detected at the site.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution! LGTM.
| //} | ||
| if ro.IsPrivate != "" { | ||
| body["is_private"] = ro.IsPrivate | ||
| body["is_private"] = strings.ToLower(strings.TrimSpace(ro.IsPrivate)) != "false" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
I understood that is_private: boolean is detected at the site.
|
Please see the new release at https://github.com/ktrysmt/go-bitbucket/releases/tag/v0.6.2 |
Adds the ability to create forks and fixes the "is_private" parameter (it's supposed to be boolean and not a string).