git-review 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/git-review.rb +3 -10
  2. metadata +3 -3
data/lib/git-review.rb CHANGED
@@ -108,15 +108,6 @@ class GitReview
108
108
  return unless request_exists?
109
109
  comment = 'Reviewed and approved.'
110
110
  response = Octokit.add_comment source_repo, @current_request['number'], comment
111
- if response[:message] == 'Issues are disabled for this repo'
112
- # Workaround: Add a pull request comment to the last commit's first file's first line.
113
- comment += "\n\nNOTE:\n Issues are disabled on this repository.\n Comments created through API calls may only be inline.\n So I chose to just post here. :P"
114
- last_commit = repo_call(:get, "pulls/#{@current_request['number']}/commits").last.sha
115
- first_file = repo_call(:get, "pulls/#{@current_request['number']}/files").first.filename
116
- response = repo_call(:post, "pulls/#{@current_request['number']}/comments",
117
- {:body => comment, :commit_id => last_commit, :path => first_file, :position => 1}
118
- )
119
- end
120
111
  if response[:body] == comment
121
112
  puts 'Successfully approved request.'
122
113
  else
@@ -402,7 +393,9 @@ class GitReview
402
393
  def discussion
403
394
  request = Octokit.pull_request(source_repo, @current_request['number'])
404
395
  result = request['discussion'].collect do |entry|
405
- output = "\e[35m#{entry["user"]["login"]}\e[m "
396
+ user = entry['user'] || entry['author']
397
+ name = user['login'].empty? ? user['name'] : user['login']
398
+ output = "\e[35m#{name}\e[m "
406
399
  case entry['type']
407
400
  # Comments:
408
401
  when "IssueComment", "CommitComment", "PullRequestReviewComment"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-review
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 6
10
- version: 1.0.6
9
+ - 7
10
+ version: 1.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dominik Bamberger