Commit c587d339b0ebc4df96ecbe824ff2ac90193fb68c
- Date: Fri Mar 07 11:52:20 +0000 2008
- Committer: Johan Sørensen (johan@johansorensen.com)
- Author: Johan Sørensen (johan@johansorensen.com)
- Commit SHA1: c587d339b0ebc4df96ecbe824ff2ac90193fb68c
- Tree SHA1: de56139c3f76a62f33fcc217801be8bb8296e64a
fixed tarball downloading
Commit diff
| |   |
| 1 | 1 | (in no particular order) |
| 2 | 2 | |
| 3 | * It's hard to figure out how to see commits in branches other than master |
| 4 | |
| 3 | 5 | * Update the HACKING with some basic coding guidelines |
| 4 | | * show MergeRequest#proposol in the mail we send to target_repository |
| 5 | 6 | * Show the most recent mergerequests on users dashboard so they can track them |
| 6 | 7 | * Make the archive download an external little mongrel/rack thing, and store the result per sha1 |
| 7 | 8 | * Comments on MergeRequests and/or votes (or just comments when you resolve) |
| toggle raw diff |
--- a/TODO.txt
+++ b/TODO.txt
@@ -1,7 +1,8 @@
(in no particular order)
+* It's hard to figure out how to see commits in branches other than master
+
* Update the HACKING with some basic coding guidelines
-* show MergeRequest#proposol in the mail we send to target_repository
* Show the most recent mergerequests on users dashboard so they can track them
* Make the archive download an external little mongrel/rack thing, and store the result per sha1
* Comments on MergeRequests and/or votes (or just comments when you resolve) |
| |   |
| 86 | 86 | |
| 87 | 87 | @commit = @git.commit(params[:sha]) |
| 88 | 88 | |
| 89 | | if not @commit.nil? |
| 90 | | prefix = "#{@project.slug}+git" |
| 91 | | data = @git.archive_tar_gz(params[:sha], prefix+"/") |
| 89 | if @commit |
| 90 | data = @git.archive_tar_gz(params[:sha]) |
| 92 | 91 | |
| 93 | | send_data(data, :disposition => 'download', :type => 'application/x-gtar', :filename => "#{prefix}.tar.gz" ) |
| 92 | send_data(data, :disposition => 'download', :type => 'application/x-gzip', |
| 93 | :filename => "#{@project.slug}+git.tar.gz" ) |
| 94 | 94 | else |
| 95 | | flash[:error] = "The repository is invalid" |
| 95 | flash[:error] = "The given repository or sha is invalid" |
| 96 | 96 | redirect_to project_repository_path(@project, @repository) and return |
| 97 | 97 | end |
| 98 | 98 | end |
| toggle raw diff |
--- a/app/controllers/browse_controller.rb
+++ b/app/controllers/browse_controller.rb
@@ -86,13 +86,13 @@ class BrowseController < ApplicationController
@commit = @git.commit(params[:sha])
- if not @commit.nil?
- prefix = "#{@project.slug}+git"
- data = @git.archive_tar_gz(params[:sha], prefix+"/")
+ if @commit
+ data = @git.archive_tar_gz(params[:sha])
- send_data(data, :disposition => 'download', :type => 'application/x-gtar', :filename => "#{prefix}.tar.gz" )
+ send_data(data, :disposition => 'download', :type => 'application/x-gzip',
+ :filename => "#{@project.slug}+git.tar.gz" )
else
- flash[:error] = "The repository is invalid"
+ flash[:error] = "The given repository or sha is invalid"
redirect_to project_repository_path(@project, @repository) and return
end
end |
| |   |
| 227 | 227 | do_get |
| 228 | 228 | response.should be_success |
| 229 | 229 | |
| 230 | | response.headers["type"].should == "application/x-gtar" |
| 230 | response.headers["type"].should == "application/x-gzip" |
| 231 | 231 | response.headers["Content-Transfer-Encoding"].should == "binary" |
| 232 | 232 | end |
| 233 | 233 | end |
| toggle raw diff |
--- a/spec/controllers/browse_controller_spec.rb
+++ b/spec/controllers/browse_controller_spec.rb
@@ -227,7 +227,7 @@ describe BrowseController do
do_get
response.should be_success
- response.headers["type"].should == "application/x-gtar"
+ response.headers["type"].should == "application/x-gzip"
response.headers["Content-Transfer-Encoding"].should == "binary"
end
end |
| |   |
| 31 | 31 | # Returns String |
| 32 | 32 | def method_missing(cmd, options = {}, *args) |
| 33 | 33 | opt_args = transform_options(options) |
| 34 | | ext_args = args.map { |a| a == '--' ? a : "'#{e(a)}'" } |
| 34 | ext_args = args.map { |a| (a == '--' or a =~ /^\s*\|/) ? a : "'#{e(a)}'" } |
| 35 | 35 | |
| 36 | 36 | call = "#{Git.git_binary} --git-dir='#{self.git_dir}' #{cmd.to_s.gsub(/_/, '-')} #{(opt_args + ext_args).join(' ')}" |
| 37 | 37 | puts call if Grit.debug |
| toggle raw diff |
--- a/vendor/grit/lib/grit/git.rb
+++ b/vendor/grit/lib/grit/git.rb
@@ -31,7 +31,7 @@ module Grit
# Returns String
def method_missing(cmd, options = {}, *args)
opt_args = transform_options(options)
- ext_args = args.map { |a| a == '--' ? a : "'#{e(a)}'" }
+ ext_args = args.map { |a| (a == '--' or a =~ /^\s*\|/) ? a : "'#{e(a)}'" }
call = "#{Git.git_binary} --git-dir='#{self.git_dir}' #{cmd.to_s.gsub(/_/, '-')} #{(opt_args + ext_args).join(' ')}"
puts call if Grit.debug |