diff options
-rw-r--r-- | lib/gitlab_update.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/gitlab_update.rb b/lib/gitlab_update.rb index d581787..4b0673f 100644 --- a/lib/gitlab_update.rb +++ b/lib/gitlab_update.rb @@ -23,8 +23,12 @@ class GitlabUpdate end def forced_push? - missed_refs = IO.popen(%W(git rev-list #{@oldrev} ^#{@newrev})).read - missed_refs.split("\n").size > 0 + if @oldrev !~ /00000000/ && @newrev !~ /00000000/ + missed_refs = IO.popen(%W(git rev-list #{@oldrev} ^#{@newrev})).read + missed_refs.split("\n").size > 0 + else + false + end end def exec |