@@ -47,25 +47,23 @@ def push
47
47
push_args << "\" #{ dequote ( url ) } \" "
48
48
push_args << "\" #{ dequote ( explicit_refspec ) } \" " unless explicit_refspec . blank?
49
49
50
- # mycom = %[ echo 'cd "#{repo_path}" ; env GIT_SSH=~/.ssh/run_gitolite_admin_ssh git push #{push_args}2>&1' | #{GitHosting.git_user_runner} "bash" ]
51
- # GitHosting.logger.error "Pushing: #{mycom}"
52
- shellout = %x[ echo 'cd "#{ repo_path } " ; env GIT_SSH=~/.ssh/run_gitolite_admin_ssh git push #{ push_args } 2>&1' | #{ GitHosting . git_user_runner } "bash" ] . chomp
50
+ shellout = %x[ echo 'cd "#{ repo_path } " ; env GIT_SSH=~/.ssh/run_gitolite_admin_ssh git push #{ push_args } 2>&1' | #{ GitHosting . git_user_runner } "bash" ] . chomp
53
51
push_failed = ( $?. to_i !=0 ) ? true : false
54
52
55
53
if ( push_failed )
56
54
GitHosting . logger . error "[ Pushing changes to mirror: #{ url } ... Failed!"
57
- GitHosting . logger . error " " + shellout . split ( "\n " ) . join ( "\n " ) + " ]"
55
+ GitHosting . logger . error " " + shellout . split ( "\n " ) . join ( "\n " ) + " ]"
58
56
else
59
57
GitHosting . logger . info "[ Pushing changes to mirror: #{ url } ... Succeeded! ]"
60
58
end
61
- [ push_failed , shellout ]
59
+ [ push_failed , shellout ]
62
60
end
63
61
64
62
# If we have an explicit refspec, check it against incoming payloads
65
63
# Special case: if we do not pass in any payloads, return true
66
64
def needs_push ( payloads = [ ] )
67
65
return true if payloads . empty?
68
- return true if push_mode == PUSHMODE_MIRROR
66
+ return true if push_mode == PUSHMODE_MIRROR
69
67
70
68
refspec_parse = explicit_refspec . match ( /^\+ ?([^:]*)(:[^:]*)?$/ )
71
69
payloads . each do |payload |
@@ -93,7 +91,7 @@ def strip_whitespace
93
91
94
92
# Put backquote in front of crucial characters
95
93
def dequote ( in_string )
96
- in_string . gsub ( /[$,"\\ \n ]/ ) { |x | "\\ " + x }
94
+ in_string . gsub ( /[$,"\\ \n ]/ ) { |x | "\\ " + x }
97
95
end
98
96
99
97
def check_refspec
@@ -142,14 +140,14 @@ def refcomp_parse(spec)
142
140
if refcomp_parse [ 1 ]
143
141
# Should be first class. If no type component, return fail
144
142
if refcomp_parse [ 3 ]
145
- { :type => refcomp_parse [ 3 ] , :name => refcomp_parse [ 4 ] }
143
+ { :type => refcomp_parse [ 3 ] , :name => refcomp_parse [ 4 ] }
146
144
else
147
145
nil
148
146
end
149
147
elsif refcomp_parse [ 3 ]
150
- { :type => nil , :name => ( refcomp_parse [ 3 ] + "/" + refcomp_parse [ 4 ] ) }
148
+ { :type => nil , :name => ( refcomp_parse [ 3 ] + "/" + refcomp_parse [ 4 ] ) }
151
149
else
152
- { :type => nil , :name => refcomp_parse [ 4 ] }
150
+ { :type => nil , :name => refcomp_parse [ 4 ] }
153
151
end
154
152
else
155
153
nil
0 commit comments