diff --git a/app/controllers/repository_mirrors_controller.rb b/app/controllers/repository_mirrors_controller.rb index 7878a5229c8..22d7e70ada2 100644 --- a/app/controllers/repository_mirrors_controller.rb +++ b/app/controllers/repository_mirrors_controller.rb @@ -96,7 +96,7 @@ def settings def push respond_to do |format| format.html { - @mirror.push + (@push_failed,@shellout) = @mirror.push } end end diff --git a/app/models/repository_mirror.rb b/app/models/repository_mirror.rb index 59baffd4167..7a80fc7e618 100644 --- a/app/models/repository_mirror.rb +++ b/app/models/repository_mirror.rb @@ -18,19 +18,12 @@ def to_s def push repo_path = GitHosting.repository_path(project) - shellout = %x[ echo 'cd "#{repo_path}" ; env GIT_SSH=~/.ssh/run_gitolite_admin_ssh git push --mirror "#{url}" 2>&1' | #{GitHosting.git_user_runner} "bash" ] + shellout = %x[ echo 'cd "#{repo_path}" ; env GIT_SSH=~/.ssh/run_gitolite_admin_ssh git push --mirror "#{url}" 2>&1' | #{GitHosting.git_user_runner} "bash" ].chomp push_failed = ($?.to_i!=0) ? true : false - - err_output = push_failed ? "" : "" if push_failed - ms = " #{mirror.url} push error " - nr = (70-ms.length)/2 - GitHosting.logger.debug "Failed:\n%{nrs} #{ms} %{nrs}\n#{shellout}%{nre} #{ms} %{nre}\n" % {:nrs => ">"*nr, :nre => "<"*nr} - err_output = err_output + ("%{nrs} #{ms} %{nrs}\n" % {:nrs => ">"*nr}) - err_output = err_output + "#{shellout}" - err_output = err_output + ("%{nre} #{ms} %{nre}\n" % {:nre => "<"*nr}) - end - err_output + GitHosting.logger.error "Mirror push error: #{url}\n#{shellout}" + end + [push_failed,shellout] end end