Skip to content

Commit 858bb2b

Browse files
committed
Test that GitHub URLs ending in .git set head to true
1 parent d8f617a commit 858bb2b

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

Library/Homebrew/formula_creator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Homebrew
88
# Class for generating a formula from a template.
99
class FormulaCreator
1010
attr_accessor :name
11-
attr_reader :version
11+
attr_reader :head, :version
1212

1313
sig {
1414
params(url: String, name: T.nilable(String), version: T.nilable(String), tap: T.nilable(String),

Library/Homebrew/test/formula_creator_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
url: "https://github.com/abitrolly/lapce.git",
2323
expected: {
2424
name: "lapce",
25+
head: true,
2526
},
2627
},
2728
"GitHub archive URL": {
@@ -46,6 +47,7 @@
4647
test.fetch(:expected).each do |key, value|
4748
expect(fc.name).to eq(value) if key == :name
4849
expect(fc.version).to eq(value) if key == :version
50+
expect(fc.head).to eq(value) if key == :head
4951
end
5052
end
5153
end

0 commit comments

Comments
 (0)