Skip to content

Commit

Permalink
a more robust merge script
Browse files Browse the repository at this point in the history
When we can't look up a user's name or email the script fails. This will cause
it to default to the user's login.

Author: @sprsquish
Fixes #375
URL: #375
  • Loading branch information
sprsquish committed Apr 15, 2014
1 parent 20d212b commit 849a5d9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/git-pull-request.rb
Expand Up @@ -207,7 +207,9 @@ def merge(number)
user_login = pull_request['user']['login']
user_obj = Github.get("users/#{user_login}")
user_name = user_obj['name']
user_name = user_login if user_name.nil? || user_name.empty?
user_email = user_obj['email']
user_email = user_login if user_email.nil? || user_email.empty?

puts "Committing"
Git.commit("--author=\"#{user_name} <#{user_email}>\" -m #{Shellwords.escape(commit_msg)} -e")
Expand Down

0 comments on commit 849a5d9

Please sign in to comment.