Skip to content

Commit

Permalink
changing revision to parse default as main from master (#44)
Browse files Browse the repository at this point in the history
* changing revision to parse default as main from master
* adding `pathname` lib to fix failing rspec test

Signed-off-by: Pranay Singh <[email protected]>
  • Loading branch information
i5pranay93 committed Jun 6, 2022
1 parent f503023 commit 3c8f067
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/cookbook-omnifetch/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def initialize(dependency, options = {})
@rel = options[:rel]

# The revision to parse
@rev_parse = options[:ref] || options[:branch] || options[:tag] || "master"
@rev_parse = options[:ref] || options[:branch] || options[:tag] || "main"
end

# @see BaseLoation#installed?
Expand Down
5 changes: 3 additions & 2 deletions spec/unit/git_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require "spec_helper"
require "cookbook-omnifetch/git"
require "pathname"

module CookbookOmnifetch
describe GitLocation do
Expand Down Expand Up @@ -69,9 +70,9 @@ def rev_parse(instance)
expect(rev_parse(instance)).to eq("v1.2.3")
end

it 'uses "master" when none is given' do
it 'uses "main" when none is given' do
instance = described_class.new(dependency, git: "https://repo.com")
expect(rev_parse(instance)).to eq("master")
expect(rev_parse(instance)).to eq("main")
end
end
end
Expand Down

0 comments on commit 3c8f067

Please sign in to comment.