]> git.openstreetmap.org Git - chef.git/blob - cookbooks/chef/libraries/git.rb
a5aa58c96a5ecac93856818341e38759a1713d1e
[chef.git] / cookbooks / chef / libraries / git.rb
1 class Chef
2   class Provider
3     class Git
4       def remote_resolve_reference
5         Chef::Log.debug("#{@new_resource} resolving remote reference")
6         command = git('ls-remote', @new_resource.repository, @new_resource.revision, "#{@new_resource.revision}^{}")
7         @resolved_reference = shell_out!(command, run_options).stdout.split("\n").last
8         if  @resolved_reference =~ /^([0-9a-f]{40})\s+(\S+)/
9           $1
10         else
11           nil
12         end
13       end
14     end
15   end
16 end