Correct url building for branch query.

Fixes drone/drone#265

Ideally this logic could be centralized, but I wasn't sure how realistic that was and this at least fixes a current bug.