Issue #6388 invalid

POST only returning the branch of the last commit when multiple commits in the same branch

Daniel Faria Gomes
created an issue

Hi.

I have a service that receives POST requests from bitbucket when a user pushes something. The problem is that when the user do multiple commits (in the same branch) before pushing, the API only returns the branch of the last commit.

JSON example: { "repository": { [...] }, "commits": [ { "node": "4307d459f62e", "branch": null, "raw_node": "4307d459f62e90ad34bfd1d0bbe34100234fb2d8", [...] }, { "node": "7a69b1bdde69", "branch": "nova-branch", "raw_node": "7a69b1bdde69d1119661eb6173582bba4f80f653", [...] } ], [...] }

Comments (4)

  1. Brian Nguyen staff

    Hi Daniel.

    Branching in Git works such that the branch reference is only applied to the head of the branch rather than on all the commits of that branch.

    This is a feature of Git's lightweight branching system, rather than anything that Bitbucket does.

    Cheers, Brian

  2. Log in to comment