diff --git a/CHANGELOG b/CHANGELOG index 5469723becad26b77aa1af503ea8a255660f7ccd..769ffb2476a39f7e417505954505850be1627cd3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,8 @@ Please view this file on the master branch, on stable branches it's out of date. v 8.8.0 (unreleased) - Project#open_branches has been cleaned up and no longer loads entire records into memory. - Log to application.log when an admin starts and stops impersonating a user + - Updated gitlab_git to 10.1.0 + - GitAccess#protected_tag? no longer loads all tags just to check if a single one exists - Make build status canceled if any of the jobs was canceled and none failed - Upgrade Sidekiq to 4.1.2 - Sanitize repo paths in new project error message diff --git a/Gemfile.lock b/Gemfile.lock index a8f7bfe43ba74416182b57ae4caa24873067d837..fe083c2b56681f5b535d4429d6470d8b46a52f95 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -353,7 +353,7 @@ GEM posix-spawn (~> 0.3) gitlab_emoji (0.3.1) gemojione (~> 2.2, >= 2.2.1) - gitlab_git (10.0.2) + gitlab_git (10.1.0) activesupport (~> 4.0) charlock_holmes (~> 0.7.3) github-linguist (~> 4.7.0) diff --git a/lib/gitlab/git_access.rb b/lib/gitlab/git_access.rb index 3ed1eec517c0143b204ae59c793e268ea483a1c0..6cb4123987151b56020fed7f3e7c7f953bc5c843 100644 --- a/lib/gitlab/git_access.rb +++ b/lib/gitlab/git_access.rb @@ -128,7 +128,7 @@ def change_access_check(change) action = if project.protected_branch?(branch_name(ref)) protected_branch_action(oldrev, newrev, branch_name(ref)) - elsif protected_tag?(tag_name(ref)) + elsif (tag_ref = tag_name(ref)) && protected_tag?(tag_ref) # Prevent any changes to existing git tag unless user has permissions :admin_project else @@ -176,7 +176,7 @@ def protected_branch_action(oldrev, newrev, branch_name) end def protected_tag?(tag_name) - project.repository.tag_names.include?(tag_name) + project.repository.tag_exists?(tag_name) end def user_allowed?