X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/7b9ec4b60ee39614d1d083d7220e76b07d2b275f..3a4d52bd4c0f8e6ae7679145846b7bc7845d8ace:/cookbooks/chef/libraries/git.rb diff --git a/cookbooks/chef/libraries/git.rb b/cookbooks/chef/libraries/git.rb index a5aa58c96..775c2da1a 100644 --- a/cookbooks/chef/libraries/git.rb +++ b/cookbooks/chef/libraries/git.rb @@ -6,7 +6,7 @@ class Chef 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+)/ - $1 + Regexp.last_match[1] else nil end