git fixes

This commit is contained in:
Timothy N. Tsvetkov 2011-03-11 13:06:14 +03:00
parent d7cedacd11
commit 20af306073
8 changed files with 14 additions and 16 deletions

View File

@ -43,12 +43,8 @@ class Git::BlobsController < Git::BaseController
end end
protected protected
def find_repository
# @repository = @project.repositories.find_by_name!(params[:repository_name])
end
def set_path def set_path
@path = params[:path].join("/") @path = params[:path]
end end
def set_treeish def set_treeish

View File

@ -5,7 +5,9 @@ class Git::TreesController < Git::BaseController
@path = params[:path] @path = params[:path]
@tree = @repository.tree(@treeish) @tree = @repository.tree(@treeish)
@tree = @tree / @path if @path
# ???
# @tree = @tree / @path if @path
render :template => "git/repositories/show" render :template => "git/repositories/show"
end end

View File

@ -1,4 +1,4 @@
.commit_row .commit_row
= render :partial => "commit_pane", :locals => { :commit => commit } = render :partial => "git/commits/commit_pane", :locals => { :commit => commit }
.row= link_to commit.message, commit_path(@platform.name, @project.name, commit.id) .row= link_to commit.message, commit_path(@platform.name, @project.name, commit.id)

View File

@ -1,6 +1,6 @@
= render :partial => "committer_pane", :locals => { :commit => commit } = render :partial => "git/commits/committer_pane", :locals => { :commit => commit }
.row.tree Tree: #{link_to @commit.tree.id, tree_path(@platform.name, @project.name, commit.tree.id)} .row.tree Tree: #{link_to commit.tree.id, tree_path(@platform.name, @project.name, commit.tree.id)}
.row.parents .row.parents
- commit.parents.each do |parent| - commit.parents.each do |parent|

View File

@ -1,5 +1,5 @@
- if @commit.committer != @commit.author - if commit.committer != commit.author
.row.author Author: #{@commit.author}, #{commit_date(@commit.authored_date)} .row.author Author: #{commit.author}, #{commit_date(commit.authored_date)}
.row.committer Committer: #{@commit.committer}, #{commit_date(@commit.committed_date)} .row.committer Committer: #{commit.committer}, #{commit_date(commit.committed_date)}
- else - else
.row.author #{@commit.author}, #{commit_date(@commit.committed_date)} .row.author #{commit.author}, #{commit_date(commit.committed_date)}

View File

@ -2,7 +2,7 @@
= render :partial => "commit_pane", :locals => { :commit => @commit} = render :partial => "commit_pane", :locals => { :commit => @commit}
#{link_to "raw diff", commit_path(@project.title, @repository.name, @commit.id, :diff)} | #{link_to "patch", commit_path(@project.title, @repository.name, @commit.id, :patch)} #{link_to "raw diff", commit_path(@platform.name, @project.name, @commit.id, :diff)} | #{link_to "patch", commit_path(@platform.name, @project.name, @commit.id, :patch)}
.row.commit_message .row.commit_message
%code!= format_commit_message(@commit.message) %code!= format_commit_message(@commit.message)

View File

@ -29,6 +29,6 @@
- if entry.is_a?(Grit::Blob) - if entry.is_a?(Grit::Blob)
= link_to entry.name, blob_path(@platform.name, @project.name, @treeish, File.join([@path, entry.name].compact)) = link_to entry.name, blob_path(@platform.name, @project.name, @treeish, File.join([@path, entry.name].compact))
- else - else
= link_to "#{entry.name}/", tree_path(@platform.name, @project.name, @repository.name, @treeish, File.join([@path, entry.name].compact)) = link_to "#{entry.name}/", tree_path(@platform.name, @project.name, @treeish, File.join([@path, entry.name].compact))
%td== &nbsp; %td== &nbsp;
%td== &nbsp; %td== &nbsp;

View File

@ -14,7 +14,7 @@ Rosa::Application.routes.draw do
# Commits # Commits
match 'platforms/:platform_name//projects/:project_name/git/commits/:treeish(/*path)', :controller => "git/commits", :action => :index, :treeish => /[0-9a-zA-Z_.\-]*/, :defaults => { :treeish => :master }, :as => :commits match 'platforms/:platform_name//projects/:project_name/git/commits/:treeish(/*path)', :controller => "git/commits", :action => :index, :treeish => /[0-9a-zA-Z_.\-]*/, :defaults => { :treeish => :master }, :as => :commits
match 'platforms/:platform_name//projects/:project_name/git/commit/:id(.:format)', :controller => "git/comnits", :action => :show, :defaults => { :format => :html }, :as => :commit match 'platforms/:platform_name//projects/:project_name/git/commit/:id(.:format)', :controller => "git/commits", :action => :show, :defaults => { :format => :html }, :as => :commit
# Blobs # Blobs
match 'platforms/:platform_name/projects/:project_name/git/blob/:treeish/*path', :controller => "git/blobs", :action => :show, :treeish => /[0-9a-zA-Z_.\-]*/, :defaults => { :treeish => :master }, :as => :blob match 'platforms/:platform_name/projects/:project_name/git/blob/:treeish/*path', :controller => "git/blobs", :action => :show, :treeish => /[0-9a-zA-Z_.\-]*/, :defaults => { :treeish => :master }, :as => :blob