diff options
-rw-r--r-- | lib/gitlab_net.rb | 1 | ||||
-rw-r--r-- | lib/gitlab_update.rb | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/gitlab_net.rb b/lib/gitlab_net.rb index cab64bd..28971ef 100644 --- a/lib/gitlab_net.rb +++ b/lib/gitlab_net.rb @@ -15,6 +15,7 @@ class GitlabNet action: cmd, ref: ref, project: project_name, + forced_push: forced_push, } params.merge!(oldrev: oldrev) if oldrev diff --git a/lib/gitlab_update.rb b/lib/gitlab_update.rb index 43d5b07..d581787 100644 --- a/lib/gitlab_update.rb +++ b/lib/gitlab_update.rb @@ -23,7 +23,7 @@ class GitlabUpdate end def forced_push? - missed_refs = IO.popen(%W(git rev-list #{@newrev}..#{@oldrev} --)).read + missed_refs = IO.popen(%W(git rev-list #{@oldrev} ^#{@newrev})).read missed_refs.split("\n").size > 0 end @@ -32,7 +32,7 @@ class GitlabUpdate # get value from it ENV['GL_ID'] = nil - if api.allowed?('git-receive-pack', @repo_name, @actor, @ref_name, @oldrev, @newrev, forced_push) + if api.allowed?('git-receive-pack', @repo_name, @actor, @ref_name, @oldrev, @newrev, forced_push?) update_redis exit 0 else |