diff --git a/lib/gitlab/git_access.rb b/lib/gitlab/git_access.rb index 0f33217460..4ca9b157f7 100644 --- a/lib/gitlab/git_access.rb +++ b/lib/gitlab/git_access.rb @@ -58,6 +58,8 @@ module Gitlab def pass_git_hooks?(user, project, ref, oldrev, newrev) return true unless project.git_hook + return true unless newrev && oldrev + git_hook = project.git_hook # Prevent tag removal