[rubygems/rubygems] Let git source use default cloned repo branch
https://github.com/rubygems/rubygems/commit/d8af770379
This commit is contained in:
parent
589c2b1fb2
commit
bd0f2c7958
@ -435,7 +435,6 @@ Gem dependencies file #{@path} requires #{name} more than once.
|
|||||||
reference ||= ref
|
reference ||= ref
|
||||||
reference ||= branch
|
reference ||= branch
|
||||||
reference ||= tag
|
reference ||= tag
|
||||||
reference ||= "master"
|
|
||||||
|
|
||||||
if ref && branch
|
if ref && branch
|
||||||
warn <<-WARNING
|
warn <<-WARNING
|
||||||
|
@ -53,7 +53,7 @@ class Gem::Source::Git < Gem::Source
|
|||||||
@uri = Gem::Uri.parse(repository)
|
@uri = Gem::Uri.parse(repository)
|
||||||
@name = name
|
@name = name
|
||||||
@repository = repository
|
@repository = repository
|
||||||
@reference = reference
|
@reference = reference || "HEAD"
|
||||||
@need_submodules = submodules
|
@need_submodules = submodules
|
||||||
|
|
||||||
@remote = true
|
@remote = true
|
||||||
|
@ -95,7 +95,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
|
|||||||
|
|
||||||
assert_equal [dep("a")], @set.dependencies
|
assert_equal [dep("a")], @set.dependencies
|
||||||
|
|
||||||
assert_equal %w[git/a master], @git_set.repositories["a"]
|
assert_equal ["git/a", nil], @git_set.repositories["a"]
|
||||||
|
|
||||||
expected = { "a" => Gem::Requirement.create("!") }
|
expected = { "a" => Gem::Requirement.create("!") }
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
|
|||||||
|
|
||||||
assert_equal [dep("a")], @set.dependencies
|
assert_equal [dep("a")], @set.dependencies
|
||||||
|
|
||||||
assert_equal %w[https://example@bitbucket.org/example/repository.git master],
|
assert_equal ["https://example@bitbucket.org/example/repository.git", nil],
|
||||||
@git_set.repositories["a"]
|
@git_set.repositories["a"]
|
||||||
|
|
||||||
expected = { "a" => Gem::Requirement.create("!") }
|
expected = { "a" => Gem::Requirement.create("!") }
|
||||||
@ -120,7 +120,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
|
|||||||
|
|
||||||
assert_equal [dep("a")], @set.dependencies
|
assert_equal [dep("a")], @set.dependencies
|
||||||
|
|
||||||
assert_equal %w[https://example@bitbucket.org/example/example.git master],
|
assert_equal ["https://example@bitbucket.org/example/example.git", nil],
|
||||||
@git_set.repositories["a"]
|
@git_set.repositories["a"]
|
||||||
|
|
||||||
expected = { "a" => Gem::Requirement.create("!") }
|
expected = { "a" => Gem::Requirement.create("!") }
|
||||||
@ -145,7 +145,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
|
|||||||
|
|
||||||
assert_equal [dep("a")], @set.dependencies
|
assert_equal [dep("a")], @set.dependencies
|
||||||
|
|
||||||
assert_equal %w[https://gist.github.com/a.git master],
|
assert_equal ["https://gist.github.com/a.git", nil],
|
||||||
@git_set.repositories["a"]
|
@git_set.repositories["a"]
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -166,7 +166,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
|
|||||||
|
|
||||||
assert_equal [dep("a")], @set.dependencies
|
assert_equal [dep("a")], @set.dependencies
|
||||||
|
|
||||||
assert_equal %w[git/a master], @git_set.repositories["a"]
|
assert_equal ["git/a", nil], @git_set.repositories["a"]
|
||||||
assert_equal %w[git/a], @git_set.need_submodules.keys
|
assert_equal %w[git/a], @git_set.need_submodules.keys
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
|
|||||||
|
|
||||||
assert_equal [dep("a")], @set.dependencies
|
assert_equal [dep("a")], @set.dependencies
|
||||||
|
|
||||||
assert_equal %w[https://github.com/example/repository.git master],
|
assert_equal ["https://github.com/example/repository.git", nil],
|
||||||
@git_set.repositories["a"]
|
@git_set.repositories["a"]
|
||||||
|
|
||||||
expected = { "a" => Gem::Requirement.create("!") }
|
expected = { "a" => Gem::Requirement.create("!") }
|
||||||
@ -196,7 +196,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
|
|||||||
|
|
||||||
assert_equal [dep("a")], @set.dependencies
|
assert_equal [dep("a")], @set.dependencies
|
||||||
|
|
||||||
assert_equal %w[https://github.com/example/example.git master],
|
assert_equal ["https://github.com/example/example.git", nil],
|
||||||
@git_set.repositories["a"]
|
@git_set.repositories["a"]
|
||||||
|
|
||||||
expected = { "a" => Gem::Requirement.create("!") }
|
expected = { "a" => Gem::Requirement.create("!") }
|
||||||
@ -609,8 +609,8 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
|
|||||||
|
|
||||||
assert_equal [dep("a"), dep("b")], @set.dependencies
|
assert_equal [dep("a"), dep("b")], @set.dependencies
|
||||||
|
|
||||||
assert_equal %w[git://example/repo.git master], @git_set.repositories["a"]
|
assert_equal ["git://example/repo.git", nil], @git_set.repositories["a"]
|
||||||
assert_equal %w[git://example/repo.git master], @git_set.repositories["b"]
|
assert_equal ["git://example/repo.git", nil], @git_set.repositories["b"]
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_git_source
|
def test_git_source
|
||||||
@ -620,7 +620,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
|
|||||||
|
|
||||||
@gda.gem "a", :example => "repo"
|
@gda.gem "a", :example => "repo"
|
||||||
|
|
||||||
assert_equal %w[git://example/repo.git master], @git_set.repositories["a"]
|
assert_equal ["git://example/repo.git", nil], @git_set.repositories["a"]
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_group
|
def test_group
|
||||||
|
Loading…
x
Reference in New Issue
Block a user