Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changing revision to parse default as main from master #44

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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