File tree 2 files changed +5
-12
lines changed
2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ def settings
96
96
def push
97
97
respond_to do |format |
98
98
format . html {
99
- @mirror . push
99
+ ( @push_failed , @shellout ) = @mirror . push
100
100
}
101
101
end
102
102
end
Original file line number Diff line number Diff line change @@ -18,19 +18,12 @@ def to_s
18
18
19
19
def push
20
20
repo_path = GitHosting . repository_path ( project )
21
- 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" ]
21
+ 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
22
22
push_failed = ( $?. to_i !=0 ) ? true : false
23
-
24
- err_output = push_failed ? "" : ""
25
23
if push_failed
26
- ms = " #{ mirror . url } push error "
27
- nr = ( 70 -ms . length ) /2
28
- GitHosting . logger . debug "Failed:\n %{nrs} #{ ms } %{nrs}\n #{ shellout } %{nre} #{ ms } %{nre}\n " % { :nrs => ">" *nr , :nre => "<" *nr }
29
- err_output = err_output + ( "%{nrs} #{ ms } %{nrs}\n " % { :nrs => ">" *nr } )
30
- err_output = err_output + "#{ shellout } "
31
- err_output = err_output + ( "%{nre} #{ ms } %{nre}\n " % { :nre => "<" *nr } )
32
- end
33
- err_output
24
+ GitHosting . logger . error "Mirror push error: #{ url } \n #{ shellout } "
25
+ end
26
+ [ push_failed , shellout ]
34
27
end
35
28
36
29
end
You can’t perform that action at this time.
0 commit comments