git-review 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/git-review.rb +5 -5
  2. metadata +3 -3
data/lib/git-review.rb CHANGED
@@ -337,9 +337,9 @@ class GitReview
337
337
  # Delete local and remote branches that match a given name.
338
338
  def delete_branch(branch_name)
339
339
  # Delete local branch if it exists.
340
- git_call("branch -D #{branch_name}") if branch_exists?(:local, branch_name)
340
+ git_call("branch -D #{branch_name}", true) if branch_exists?(:local, branch_name)
341
341
  # Delete remote branch if it exists.
342
- git_call("push origin :#{branch_name}") if branch_exists?(:remote, branch_name)
342
+ git_call("push origin :#{branch_name}", true) if branch_exists?(:remote, branch_name)
343
343
  end
344
344
 
345
345
  # Returns a boolean stating whether there are unmerged commits on the local or remote branch.
@@ -356,9 +356,9 @@ class GitReview
356
356
  responses = locations.collect do |location|
357
357
  git_call "cherry #{location.first}#{target_branch} #{location.last}#{branch_name}"
358
358
  end
359
- # Select commits (= non empty and not just an error message).
360
- unmerged_commits = responses.select do |response|
361
- not (response.empty? or response.include?('fatal: Unknown commit'))
359
+ # Select commits (= non empty, not just an error message and not only duplicate commits staring with '-').
360
+ unmerged_commits = responses.reject do |response|
361
+ response.empty? or response.include?('fatal: Unknown commit') or response.split("\n").reject{|x| x.index('-') == 0}.empty?
362
362
  end
363
363
  # If the array ain't empty, we got unmerged commits.
364
364
  if unmerged_commits.empty?
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: 17
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 3
10
- version: 1.0.3
9
+ - 5
10
+ version: 1.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dominik Bamberger