module Chef::Steel::Git
Public Instance Methods
git_clone(repo, destination)
click to toggle source
Clone a repo into a given destination. We assume the destination is a temporary directory.
# File lib/chef/steel/git.rb, line 11 def git_clone(repo, destination) result = `git clone -q #{repo} #{destination}` if $?.exitstatus != 0 error "Failed to clone #{repo} into #{destination} (Exit status: #{$?.exitstatus})!" error "Result: #{result}" unless result.empty? exit $?.exitstatus end end
git_diff(local_file, remote_file)
click to toggle source
# File lib/chef/steel/git.rb, line 20 def git_diff(local_file, remote_file) result = `git diff --color=always #{local_file} #{remote_file}` log "" result.split("\n").each do |line| raw_log "\t" + line end end