Get commit/{revision} API does not accept branch names with "/" (BB-10992)

Issue #9969 open
Ragesh Krishna
created an issue

My branch is called "feature/test" and no matter how I try to hit the GET{owner}/{repo_slug}/commit/{revision} API with this, it will not bend. Replacing the "/" with %2F does not work.

Google helped me find where this seems to have been fixed for every other API call except this one.

I'd like to know if there is a plan for this to be fixed, or if there is another way I can get the commit SHA for the tip of a branch whose name has a slash.

Official response

Comments (28)

  1. Rastko Jokic


    Any updates on this issue?

    I am from Semaphore CI and I am in charge for Bitbucket integration. This issue is hurting our users pretty bad and we are taking a lot of heat, since it is essential for their workflow...

    Thanks in advance.

    Best, Rastko

  2. Roman Allenstein

    Hi! Any update on this? I am using git-flow which has the naming-convention of "feature/...." and trying to work the API. Unfortunately this ticket is still open.

    +1 to fix this one. :-)

  3. Steve Muskiewicz

    This most certainly is not fixed, I just tested it on one of our repos. For any branch with a slash in it, I get a "404 not found" response (even when using %2F to encode the slash).

    It would be nice if you actually verified things as fixed instead of just closing them with "looks like it was fixed"...this is extremely frustrating to me as an end user!

  4. Zachary Davis

    Hi Steve,

    I am personally trying to reconcile the statuses of issues on our internal tracker with this issue tracker, on the order of slightly more than 14,000 issues, with the goal of narrowing down the list of open issues to ones that actually need attention. You are correct that I did not verify whether this was actually fixed or not, but I did verify that a pull request was merged and deployed which purported to fix this issue in July of 2014. Hopefully you can forgive me for not verifying each of the 14,000 issues individually. I'm happy to reopen this and the corresponding internal issue.


  5. Steve Muskiewicz

    Hi Zach,

    I apologize if my response seemed personally directed at you (it was not) but I hope you will also appreciate my source of frustration here. As you are no doubt well aware, this is one of (too) many Bitbucket issues that have remained in an unresolved state for multiple years now, with no comment or acknowledgment from Atlassian, despite multiple user votes, "+1"'s and requests for status updates. And to me this particular issue is more egregious in that it was (apparently) fixed but then just as quickly reverted with a terse explanation and no follow up despite the comment to the contrary.

    So while I am certainly happy to see that some of these issues are getting some long overdue attention and definitely sympathetic to you as the unlucky dude who is tasked with plowing through this mess, I can't help but think that if Atlassian/Bitbucket had not proceeded to ignore them for such a long period of time that they would not be in this position now.

    Thank you in advance for all your efforts and I would definitely appreciate it if you could reopen this issue so that hopefully someone can give it another look in the near future.

    regards, -steve

  6. Kaleb Elwert

    As you can see, I've attempted a fix for this before, however it broke a number of APIs (Everything at aside from the basic one) so it had to be reverted.

    The way our APIs are structured, it will not be possible to add support to this endpoint for branch names until we release a new major revision because for v2, it will either shadow APIs or some branches won't be accessible.

    However, there is a workaround which just involves one additional request to grab the commit hash then using that in any of the endpoints. should work with branch names which contain slashes.

    I'm leaving this open, but dropping the priority because our hands are tied and there is an existing workaround.

    Sorry for the inconvenience.

  7. Log in to comment