aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorShaun Jackman2017-10-18 23:32:06 -0700
committerShaun Jackman2017-10-22 08:52:16 -0700
commitf9d42659ea951896733f49394a50366fb55eaafb (patch)
treeddf49eb4e7e65ff36132861679265c6bd9201d3b /Library
parenta08f1c674803824e291c326adc2aca80068020e6 (diff)
downloadbrew-f9d42659ea951896733f49394a50366fb55eaafb.tar.bz2
pull: Fix pull --bottle 1234
Fix the error: Error: undefined method `casecmp' for nil:NilClass
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/dev-cmd/pull.rb7
-rw-r--r--Library/Homebrew/tap.rb6
-rw-r--r--Library/Homebrew/test/dev-cmd/pull_spec.rb2
-rw-r--r--Library/Homebrew/test/tap_spec.rb1
4 files changed, 7 insertions, 9 deletions
diff --git a/Library/Homebrew/dev-cmd/pull.rb b/Library/Homebrew/dev-cmd/pull.rb
index 79b9da9eb..7746e4db3 100644
--- a/Library/Homebrew/dev-cmd/pull.rb
+++ b/Library/Homebrew/dev-cmd/pull.rb
@@ -87,11 +87,8 @@ module Homebrew
tap = nil
ARGV.named.each do |arg|
- if arg.to_i.positive?
- issue = arg
- url = "https://github.com/Homebrew/homebrew-core/pull/#{arg}"
- tap = CoreTap.instance
- elsif (testing_match = arg.match %r{/job/Homebrew.*Testing/(\d+)/})
+ arg = "#{CoreTap.instance.default_remote}/pull/#{arg}" if arg.to_i.positive?
+ if (testing_match = arg.match %r{/job/Homebrew.*Testing/(\d+)/})
tap = ARGV.value("tap")
tap = if tap&.start_with?("homebrew/")
Tap.fetch("homebrew", tap.strip_prefix("homebrew/"))
diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb
index ebfc4cd80..2d1c47e32 100644
--- a/Library/Homebrew/tap.rb
+++ b/Library/Homebrew/tap.rb
@@ -26,11 +26,11 @@ class Tap
raise "Invalid tap name '#{args.join("/")}'"
end
- # we special case homebrew so users don't have to shift in a terminal
- user = "Homebrew" if user == "homebrew"
+ # We special case homebrew and linuxbrew so that users don't have to shift in a terminal.
+ user = user.capitalize if ["homebrew", "linuxbrew"].include? user
repo = repo.strip_prefix "homebrew-"
- if user == "Homebrew" && (repo == "homebrew" || repo == "core")
+ if ["Homebrew", "Linuxbrew"].include?(user) && ["core", "homebrew"].include?(repo)
return CoreTap.instance
end
diff --git a/Library/Homebrew/test/dev-cmd/pull_spec.rb b/Library/Homebrew/test/dev-cmd/pull_spec.rb
index 9815ef9a1..984ac0843 100644
--- a/Library/Homebrew/test/dev-cmd/pull_spec.rb
+++ b/Library/Homebrew/test/dev-cmd/pull_spec.rb
@@ -22,7 +22,7 @@ describe "brew pull", :integration_test do
.and output(/Current branch is new\-branch/).to_stderr
.and be_a_failure
- expect { brew "pull", "--bump", "8" }
+ expect { brew "pull", "--bump", "https://github.com/Homebrew/homebrew-core/pull/8" }
.to output(/Fetching patch/).to_stdout
.and output(/No changed formulae found to bump/).to_stderr
.and be_a_failure
diff --git a/Library/Homebrew/test/tap_spec.rb b/Library/Homebrew/test/tap_spec.rb
index d69eb615c..76af27b92 100644
--- a/Library/Homebrew/test/tap_spec.rb
+++ b/Library/Homebrew/test/tap_spec.rb
@@ -61,6 +61,7 @@ describe Tap do
specify "::fetch" do
begin
+ expect(described_class.fetch("Homebrew", "core")).to be_kind_of(CoreTap)
expect(described_class.fetch("Homebrew", "homebrew")).to be_kind_of(CoreTap)
tap = described_class.fetch("Homebrew", "foo")
expect(tap).to be_kind_of(Tap)