15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/dockly/util/git.rb', line 15
def archive(oid, prefix, output)
prefix = prefix.dup
unless prefix[-1] == '/'; prefix << '/'; end
cmd = ['git','archive',"--prefix=#{prefix}",'--output=/dev/stdout',oid]
Open3.popen3(*cmd) do |stdin, stdout, stderr, wait_thr|
stdin.close
output.write(stdout.read)
process_status = wait_thr.value
exit_status = process_status.exitstatus
raise "#{cmd.join(' ')} exitted non-zero: #{exit_status}" unless exit_status.zero?
end
end
|