Skip to content

Commit

Permalink
better comments for Repo#archive_to_file
Browse files Browse the repository at this point in the history
  • Loading branch information
mojombo committed Mar 1, 2009
1 parent 81a0667 commit 37b967c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/grit/repo.rb
Expand Up @@ -338,12 +338,19 @@ def archive_tar_gz(treeish = 'master', prefix = nil)
self.git.archive(options, treeish, "| gzip")
end

# run archive directly to a file
def archive_to_file(treeish = 'master', prefix = nil, filename = 'archive.tar.gz', format = nil, pipe = "| gzip")
# Write an archive directly to a file
# +treeish+ is the treeish name/id (default 'master')
# +prefix+ is the optional prefix (default nil)
# +filename+ is the name of the file (default 'archive.tar.gz')
# +format+ is the optional format (default nil)
# +pipe+ is the command to run the output through (default 'gzip')
#
# Returns nothing
def archive_to_file(treeish = 'master', prefix = nil, filename = 'archive.tar.gz', format = nil, pipe = "gzip")
options = {}
options[:prefix] = prefix if prefix
options[:format] = format if format
self.git.archive(options, treeish, "#{pipe} > #{filename}")
self.git.archive(options, treeish, "| #{pipe} > #{filename}")
end

# Enable git-daemon serving of this repository by writing the
Expand Down

0 comments on commit 37b967c

Please sign in to comment.