diff --git a/Gemfile b/Gemfile index 65f5da383..60869b4bb 100644 --- a/Gemfile +++ b/Gemfile @@ -81,7 +81,7 @@ end group :test do gem 'rspec-rails', '~> 2.11.0', :group => 'development' - gem 'factory_girl_rails', '~> 3.5.0' + gem 'factory_girl_rails', '~> 3.6.0' gem 'rr', '~> 1.0.4' gem 'shoulda' end diff --git a/Gemfile.lock b/Gemfile.lock index 8d70a5ad0..896f7a8ab 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,7 +8,7 @@ GIT GIT remote: git://github.com/github/gollum.git - revision: c9bc2a89f655760c0a21da6d3ab37c5f6267e96c + revision: 8422b712048656c8ea391c2d7ef27fb29f66746b specs: gollum (2.1.0) github-markdown @@ -125,10 +125,10 @@ GEM execjs (1.4.0) multi_json (~> 1.0) expression_parser (0.9.0) - factory_girl (3.5.0) + factory_girl (3.6.0) activesupport (>= 3.0.0) - factory_girl_rails (3.5.0) - factory_girl (~> 3.5.0) + factory_girl_rails (3.6.0) + factory_girl (~> 3.6.0) railties (>= 3.0.0) ffi (1.0.11) fssm (0.2.9) @@ -376,7 +376,7 @@ DEPENDENCIES creole devise (~> 2.1.2) diff-display (~> 0.0.1) - factory_girl_rails (~> 3.5.0) + factory_girl_rails (~> 3.6.0) github-linguist (~> 2.1.2) gollum! grack! diff --git a/app/helpers/git_helper.rb b/app/helpers/git_helper.rb index 753db6e64..853c69b8a 100644 --- a/app/helpers/git_helper.rb +++ b/app/helpers/git_helper.rb @@ -54,7 +54,9 @@ module GitHelper current = url_for(p).split('?', 2).first res = [] - res << [I18n.t('layout.git.repositories.commits'), [params[:treeish].truncate(20)]] unless project.repo.branches_and_tags.map(&:name).include?(params[:treeish] || project.default_branch) + if params[:treeish].present? && !project.repo.branches_and_tags.map(&:name).include?(params[:treeish]) + res << [I18n.t('layout.git.repositories.commits'), [params[:treeish].truncate(20)]] + end linking = Proc.new {|t| [t.name.truncate(20), url_for(p.merge :treeish => t.name).split('?', 2).first]} res << [I18n.t('layout.git.repositories.branches'), project.repo.branches.map(&linking)] res << [I18n.t('layout.git.repositories.tags'), project.repo.tags.map(&linking)] diff --git a/lib/ext/rosa/constraints.rb b/lib/ext/rosa/constraints.rb index 54e9e6191..fd7f45fbf 100644 --- a/lib/ext/rosa/constraints.rb +++ b/lib/ext/rosa/constraints.rb @@ -21,8 +21,7 @@ module Rosa class Treeish def self.matches?(request) - params = request.path_parameters - if params[:treeish] # parse existing branch (tag) and path + if (params = request.path_parameters) && params[:treeish] # parse existing branch (tag) and path branch_or_tag = begin (p = Project.find_by_owner_and_name params[:owner_name], params[:project_name]) && p.repo.branches_and_tags.detect{|t| params[:treeish].start_with?(t.name)}.try(:name) ||