Skip to content

Commit eaffb56

Browse files
committed
Merge pull request #58 from rspec/add_option_to_force_push
Allow force pushing when normal push fails
2 parents 659222e + 018e1ab commit eaffb56

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Rakefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,15 @@ namespace :travis do
285285
branch = update_travis_files_in_repos
286286

287287
each_project_with_common_travis_build do |name|
288-
sh "git push origin #{branch}"
289-
create_pull_request(name, branch)
288+
unless system("git push origin #{branch}")
289+
puts "Push failed, force?"
290+
if STDIN.gets.downcase == /^y/
291+
sh "git push origin +#{branch}"
292+
end
293+
create_pull_request(name, branch) rescue nil
294+
else
295+
create_pull_request(name, branch)
296+
end
290297
sh "git checkout #{BASE_BRANCH} && git branch -D #{branch}" # no need to keep it around
291298
end
292299
end

0 commit comments

Comments
 (0)