X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/3a4d52bd4c0f8e6ae7679145846b7bc7845d8ace..a74b0487fe7b9ca6d7220fa2d31bb188e10aa838:/cookbooks/chef/libraries/git.rb?ds=sidebyside diff --git a/cookbooks/chef/libraries/git.rb b/cookbooks/chef/libraries/git.rb index 775c2da1a..ae797fc00 100644 --- a/cookbooks/chef/libraries/git.rb +++ b/cookbooks/chef/libraries/git.rb @@ -1,16 +1,13 @@ -class Chef - class Provider - class Git - def remote_resolve_reference - Chef::Log.debug("#{@new_resource} resolving remote reference") - command = git('ls-remote', @new_resource.repository, @new_resource.revision, "#{@new_resource.revision}^{}") - @resolved_reference = shell_out!(command, run_options).stdout.split("\n").last - if @resolved_reference =~ /^([0-9a-f]{40})\s+(\S+)/ - Regexp.last_match[1] - else - nil - end +module OpenStreetMap + module Provider + module Git + def git(*args, **run_opts) + args.push("--force") if args.first == "fetch" && args.last == "--tags" + + super(args, run_opts) end end end end + +Chef::Provider::Git.prepend(OpenStreetMap::Provider::Git)