New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Protected Branch Name Must be Unique Across Projects (with fix) #406

wilsoc5 opened this Issue Apr 3, 2015 · 1 comment


None yet
2 participants
Copy link

wilsoc5 commented Apr 3, 2015

We have multiple Xitolite repos across multiple projects hosted on the same Redmine instance. I'm starting to roll out protected branches to ensure no one clobbers the master or the release branches of the git repo. This works for one project. However, as soon as a protected branch name, e.g. master, is used in one project it cannot be used in others.

The fix:
in app/models/repository_protected_branche.rb
The lines:

  ## Validations
  validates :repository_id, presence: true
  validates :path,          presence: true, uniqueness: { scope: :permissions }
  validates :permissions,   presence: true, inclusion: { in: VALID_PERMS }
  validates :user_list,     presence: true

validates :path should be updated

  validates :path,          presence: true, uniqueness: { scope: [:permissions, :repository_id] }

This comment has been minimized.

Copy link

n-rodriguez commented Apr 4, 2015

Merged! Thank you!

@n-rodriguez n-rodriguez closed this Apr 4, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment