#385: added rsa to name of archives for git branches

This commit is contained in:
Vokhmin Alexey V 2012-09-20 00:38:40 +04:00
parent f39adfd2f7
commit 9d2c9ae2b3
2 changed files with 6 additions and 2 deletions

View File

@ -12,7 +12,7 @@ class Projects::Git::BaseController < Projects::BaseController
def set_treeish_and_path
@treeish = params[:treeish].presence
unless @treeish
commit = @project.repo.commits(@project.default_branch).first
commit = @project.repo.commits(@project.default_branch, 1).first
@treeish = commit ? commit.id : @project.default_branch
end
@path = params[:path]
@ -21,6 +21,10 @@ class Projects::Git::BaseController < Projects::BaseController
def set_branch_and_tree
@branch = @project.repo.branches.detect{|b| b.name == @treeish}
@tree = @project.repo.tree(@treeish)
if @branch
commit = @project.repo.commits(@treeish, 1).first
@treeish = commit.id if commit
end
# raise Grit::NoSuchPathError if @tree.blobs.blank?
end
end

View File

@ -14,7 +14,7 @@ class Projects::Git::TreesController < Projects::Git::BaseController
format = params[:format]
if (@treeish =~ /^#{@project.owner.uname}-#{@project.name}-/) && !(@treeish =~ /[\s]+/) && (format =~ /^[\w]+$/)
@treeish = @treeish.gsub(/^#{@project.owner.uname}-#{@project.name}-/, '')
@commit = @project.repo.log(@treeish, nil, :max_count => 1).first
@commit = @project.repo.commits(@treeish, 1).first
end
raise Grit::NoSuchPathError unless @commit
name = "#{@project.owner.uname}-#{@project.name}-#{@treeish}"