Skip to content

Commit

Permalink
Fix #<TypeError: no implicit conversion of nil into String> when mirr…
Browse files Browse the repository at this point in the history
…or doesn't need updates
  • Loading branch information
root committed Sep 11, 2015
1 parent 36000d0 commit f9cd767
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions app/services/hooks/git_mirrors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,18 @@ def execute(repository, payloads)


def execute
call_mirror if needs_push?
y = ''

logger.info("Pushing changes to #{url} ... ")
y << " - Pushing changes to #{url} ... "

if needs_push?
y << call_mirror
else
y << "This mirror doesn't need to be updated\n"
end

y
end


Expand Down Expand Up @@ -72,23 +83,16 @@ def check_ref_spec


def call_mirror
y = ''

logger.info("Pushing changes to #{url} ... ")
y << " - Pushing changes to #{url} ... "

push_failed, push_message = MirrorPush.new(mirror).call

if push_failed
logger.error('Failed!')
logger.error("#{push_message}")
y << " [failure]\n"
" [failure]\n"
else
logger.info('Succeeded!')
y << " [success]\n"
" [success]\n"
end

y
end


Expand Down

0 comments on commit f9cd767

Please sign in to comment.