Pushing a commit on a restricted branching with a tag allows the push to go through partially. (BB-15735)

Issue #12294 duplicate
Gideon Koh created an issue

Assume a user is not allowed to push to a specific branch. That user made a new commit on that branch in a local repository, and added a tag onto the commit.

Pushing the tag will cause the commit to be pushed as well, though the commit wouldn't show in the history of the branch, but rather it will show when the specific commit URL is searched.

Steps to reproduce:

  1. Create new branch (and lock it on bitbucket). With a user who is not allowed to push to that branch:
  2. Make a commit
  3. Add tag on that commit
  4. Push to bitbucket
  5. Go the url for that specific commit

It will show in a specific commit URL: https://bitbucket.org/username/repositoryname/commits/xxxxxxx

But it won't show up in the branch commit history log: https://bitbucket.org/digipolisgent/username/repositoryname/commits/branch/branchname

Comments (6)

  1. Sean Farley

    This isn't a bug so much as it is how git works. The reason that those commits didn't show up in the branch commit history log is because the branch restriction worked. It did not move the master ref forward. However, that user is allowed to push up new tags. And those commits are only referenced by that tag on Bitbucket. Perhaps this is confusing by locally the user would see that master is pointing to something that origin is not.

  2. Dieter Blomme

    Even if it's invalid (which I don't agree with), I'd expect to find reference to this in documentation somewhere ...

  3. Log in to comment