Skip to content

Commit d6524ca

Browse files
author
Valentino
committed
Fix lgtm checks and use pull request body for merge message
Closes #33 LGTM given by: @nhance Squashed commit of the following: commit c169515 Author: Valentino <valentino@reenhanced.com> Date: Mon Mar 4 09:52:12 2013 -0500 Bumbed version for gem updates commit 7ff11b3 Author: Valentino <valentino@reenhanced.com> Date: Mon Mar 4 09:50:54 2013 -0500 Use pull request body OR last commit message commit 75687f5 Author: Valentino <valentino@reenhanced.com> Date: Wed Dec 26 10:06:00 2012 -0500 [fix] lgtm checks are buggy commit 124b1e5 Author: Valentino <valentino@reenhanced.com> Date: Thu Dec 6 15:43:19 2012 -0500 Ensure comment author lookup is unique
1 parent 4d1d1ed commit d6524ca

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/git_reflow.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def deliver(options = {})
7979
# if there any comment_authors left, then they haven't given a lgtm after the last commit
8080
if open_comment_authors.empty? or options['skip-lgtm']
8181
lgtm_authors = comment_authors_for_pull_request(existing_pull_request, :with => LGTM)
82-
commit_message = get_first_commit_message
82+
commit_message = existing_pull_request[:body] || get_first_commit_message
8383
puts "Merging pull request ##{existing_pull_request.number}: '#{existing_pull_request.title}', from '#{existing_pull_request.head.label}' into '#{existing_pull_request.base.label}'"
8484

8585
update_destination(options['base'])
@@ -210,9 +210,9 @@ def find_authors_of_open_pull_request_comments(pull_request)
210210
comment_created_at = Time.parse(comment.created_at)
211211
if comment_created_at > pull_last_committed_at
212212
if comment[:body] =~ LGTM
213-
lgtm_authors << comment.user.login
213+
lgtm_authors |= [comment.user.login]
214214
else
215-
comment_authors << comment.user.login unless comment_authors.include?(comment.user.login)
215+
comment_authors |= [comment.user.login] unless comment_authors.include?(comment.user.login)
216216
end
217217
else
218218
comment_authors -= [comment.user.login] if comment_authors.include?(comment.user.login)
@@ -230,7 +230,7 @@ def comment_authors_for_pull_request(pull_request, options = {})
230230

231231
all_comments.each do |comment|
232232
next if options[:after] and Time.parse(comment.created_at) < options[:after]
233-
comment_authors << comment.user.login if !comment_authors.include?(comment.user.login) and (options[:with].nil? or comment[:body] =~ options[:with])
233+
comment_authors |= [comment.user.login] if !comment_authors.include?(comment.user.login) and (options[:with].nil? or comment[:body] =~ options[:with])
234234
end
235235

236236
# remove the current user from the list to check

lib/git_reflow/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module GitReflow
2-
VERSION = "0.2.4"
2+
VERSION = "0.2.5"
33
end

0 commit comments

Comments
 (0)