FIX: Pulling an individual commit was broken by 079055c1

FIX: Pulling an individual commit was broken by 079055c1

diff --git a/lib/discourse_code_review/github_repo.rb b/lib/discourse_code_review/github_repo.rb
index af49683..4569459 100644
--- a/lib/discourse_code_review/github_repo.rb
+++ b/lib/discourse_code_review/github_repo.rb
@@ -106,9 +106,9 @@ module DiscourseCodeReview
 
       github_info = []
 
-      range = single ? "-1 #{hash}" : "#{hash}.."
+      range = single ? ["-1", hash] : ["#{hash}.."]
 
-      commits = git("log", range, "--pretty=%H").split("\n").map { |x| x.strip }
+      commits = git("log", *range, "--pretty=%H").split("\n").map { |x| x.strip }
 
       if merge_github_info
         commits.each_slice(30).each do |x|
@@ -130,7 +130,7 @@ module DiscourseCodeReview
       # hash name email subject body
       format = %w{%H %aN %aE %s %B %at}.join(FIELD_END) << LINE_END
 
-      data = git("log", range, "--pretty=#{format}")
+      data = git("log", *range, "--pretty=#{format}")
 
       data.split(LINE_END).map do |line|
         fields = line.split(FIELD_END).map { |f| f.strip if f }

GitHub sha: 4391fc70

1 Like