#385: added rsa to name of archives for git branches
This commit is contained in:
parent
f39adfd2f7
commit
9d2c9ae2b3
|
@ -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
|
||||
|
|
|
@ -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}"
|
||||
|
|
Loading…
Reference in New Issue