lib/rim/upload_module_helper.rb
def copy_revision_files(src_session, src_sha1, dest_dir, ignores)
    Dir.mktmpdir do |tmp_dir|
      tmp_dir = Dir.glob(tmp_dir)[0]
      src_session.execute("git archive --format tar #{src_sha1} #{@module_info.local_path} | tar -C #{tmp_dir} -xf -")
      tmp_module_dir = File.join(tmp_dir, @module_info.local_path)
      files = FileHelper.find_matching_files(tmp_module_dir, false, "/**/*", File::FNM_DOTMATCH)
      files.delete(".")
      files.delete("..")
      files.delete(RimInfo::InfoFileName)
      files -= FileHelper.find_matching_files(tmp_module_dir, false, ignores)
      # have source files now. Now clear destination folder and copy
      prepare_empty_folder(dest_dir, ".git/**/*")
      files.each do |f|
        src_path = File.join(tmp_module_dir, f)
        if File.file?(src_path)
          path = File.join(dest_dir, f)
          FileUtils.mkdir_p(File.dirname(path))
          FileUtils.cp(src_path, path)
        end        
      end
    end 
  end
def copy_revision_files(src_session, src_sha1, dest_dir, ignores)
    Dir.mktmpdir do |tmp_dir|
      tmp_dir = Dir.glob(tmp_dir)[0]
      src_session.execute("git archive --format tar #{src_sha1} #{@module_info.local_path} | tar -C #{tmp_dir} -xf -")
      tmp_module_dir = File.join(tmp_dir, @module_info.local_path)
      files = FileHelper.find_matching_files(tmp_module_dir, false, "/**/*", File::FNM_DOTMATCH)
      files.delete(".")
      files.delete("..")
      files.delete(RimInfo::InfoFileName)
      files -= FileHelper.find_matching_files(tmp_module_dir, false, ignores)
      # have source files now. Now clear destination folder and copy
      prepare_empty_folder(dest_dir, ".git/**/*")
      files.each do |f|
        src_path = File.join(tmp_module_dir, f)
        if File.file?(src_path)
          path = File.join(dest_dir, f)
          FileUtils.mkdir_p(File.dirname(path))
          FileUtils.cp(src_path, path)
        end        
      end
    end 
  end
copy files from given source revision into destination dir