File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -261,6 +261,7 @@ def sh(cmd)
261261 Grit . log cmd if Grit . debug
262262 out = `#{ cmd } `
263263 Grit . log out if Grit . debug
264+ return out
264265 end
265266
266267 def port_changes
@@ -283,7 +284,8 @@ def port_changes
283284 @to_replay = @repo . revs_between ( @common , @current )
284285
285286 # Ok, try again.
286- error = @repo . git . checkout ( { :q => true } , @origin )
287+ # Use sh, since the git proxy seems to fuck up $?
288+ error = sh "git checkout -q #{ @origin } 2>&1"
287289 if $?. exitstatus != 0
288290 # Ok, give up.
289291 recover
@@ -292,11 +294,27 @@ def port_changes
292294 puts "ERROR: Sorry, 'git checkout' can't figure out how to properly switch"
293295 puts "the working copy. Please fix this and run 'git update' again."
294296 puts "Here is the error that 'git checkout' reported:"
297+ puts
295298 puts error
299+ puts
296300 exit 1
297301 end
298302 else
299- @repo . git . checkout ( { :q => true } , @origin )
303+ error = sh "git checkout -q #{ @origin } 2>&1"
304+
305+ if $?. exitstatus != 0
306+ # Ok, give up.
307+ recover
308+
309+ # Now tell the user what happened.
310+ puts "ERROR: Sorry, 'git checkout' can't figure out how to properly switch"
311+ puts "the working copy. Please fix this and run 'git update' again."
312+ puts "Here is the error that 'git checkout' reported:"
313+ puts
314+ puts error
315+ puts
316+ exit 1
317+ end
300318 end
301319
302320 sh "git format-patch --full-index --stdout #{ @common } ..#{ @current } > .git/update-patch"
You can’t perform that action at this time.
0 commit comments