#5050 403 Forbidden when deleting master branch when it is not default branch
Closed: Fixed 3 years ago by pingou. Opened 3 years ago by jflory7.

Summary

Cannot delete branch named master even if it is not the default project branch

Background

Recently, I changed a couple of repositories to use main and rawhide as the default git branch. Since they are in parity with master, I want to delete master since it is a duplicate branch. However, Pagure does not let me delete it, as it seems that any master branch is a protected keyword for git branches.

Details

Expected outcome:

  1. Create new branch main.
  2. Change Pagure default branch to main from master.
  3. Go to Pagure branches page, click trash can button next to master branch.
  4. master branch is successfully deleted from the repository.

Actual outcome:

  1. Create new branch main.
  2. Change Pagure default branch to main from master.
  3. Go to Pagure branches page, click trash can button next to master branch.
  4. Redirect to a barebone HTML page that just says: Forbidden: You are not allowed to delete the master branch
  5. master branch still exists on repo.

Outcome

Unnecessary git branches named master should be deleted when it is not the default git branch for a project


Could you point me to such project?

Could you point me to such project?

Nevermind, I could reproduce this locally, thanks for the report :)

Metadata Update from @pingou:
- Issue assigned to pingou
- Issue set to the milestone: 5.12
- Issue tagged with: bug

3 years ago

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #5051 Merged 3 years ago