diff options
Diffstat (limited to 'lib/gitlab_update.rb')
-rw-r--r-- | lib/gitlab_update.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/gitlab_update.rb b/lib/gitlab_update.rb index 742d5fd..43d5b07 100644 --- a/lib/gitlab_update.rb +++ b/lib/gitlab_update.rb @@ -22,12 +22,17 @@ class GitlabUpdate @newrev = ARGV[2] end + def forced_push? + missed_refs = IO.popen(%W(git rev-list #{@newrev}..#{@oldrev} --)).read + missed_refs.split("\n").size > 0 + end + def exec # reset GL_ID env since we already # get value from it ENV['GL_ID'] = nil - if api.allowed?('git-receive-pack', @repo_name, @actor, @ref_name, @oldrev, @newrev) + if api.allowed?('git-receive-pack', @repo_name, @actor, @ref_name, @oldrev, @newrev, forced_push) update_redis exit 0 else |