-
Notifications
You must be signed in to change notification settings - Fork 113
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
Add support for refs to BuildLast #59
base: master
Are you sure you want to change the base?
Conversation
ping |
1 similar comment
ping |
This is the main (remaining) reason we have to maintain our fork at https://github.com/owncloud-ci/drone-cli |
ping? |
@@ -266,7 +266,11 @@ func (c *client) BuildLast(owner, name, branch string) (*Build, error) { | |||
out := new(Build) | |||
uri := fmt.Sprintf(pathBuild, c.addr, owner, name, "latest") | |||
if branch != "" { | |||
uri += "?branch=" + branch | |||
if strings.HasPrefix(branch, "refs/") { | |||
uri += "?ref=" + branch |
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 think it would be cleaner to create a new function BuildLastRef and call the parameter ref. This change still uses "branch" which isn't as clear to read.
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.
Also with this change the comment is no longer correct.
No description provided.