Commit 56d15660 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

gitlab_git to 1.0.6, return submodule rendering in tree

parent 083d6656
...@@ -8,6 +8,7 @@ v 5.2.0 ...@@ -8,6 +8,7 @@ v 5.2.0
- Move Gitlab::Git code to gitlab_git gem - Move Gitlab::Git code to gitlab_git gem
- Move update docs in repo - Move update docs in repo
- requires gitlab-shell v1.4.0 - requires gitlab-shell v1.4.0
- fixed submodules listing under file tab
v 5.1.0 v 5.1.0
- You can login with email or username now - You can login with email or username now
......
...@@ -24,7 +24,7 @@ gem 'omniauth-github' ...@@ -24,7 +24,7 @@ gem 'omniauth-github'
# Extracting information from a git repository # Extracting information from a git repository
# We cannot use original git since some bugs # We cannot use original git since some bugs
gem "grit", '~> 2.5.0', git: 'https://github.com/gitlabhq/grit.git', ref: '42297cdcee16284d2e4eff23d41377f52fc28b9d' gem "grit", '~> 2.5.0', git: 'https://github.com/gitlabhq/grit.git', ref: '42297cdcee16284d2e4eff23d41377f52fc28b9d'
gem 'gitlab_git', '~> 1.0.5' gem 'gitlab_git', '~> 1.0.6'
# Ruby/Rack Git Smart-HTTP Server Handler # Ruby/Rack Git Smart-HTTP Server Handler
gem 'gitlab-grack', '~> 1.0.0', require: 'grack' gem 'gitlab-grack', '~> 1.0.0', require: 'grack'
......
...@@ -165,7 +165,7 @@ GEM ...@@ -165,7 +165,7 @@ GEM
gitlab-pygments.rb (0.3.2) gitlab-pygments.rb (0.3.2)
posix-spawn (~> 0.3.6) posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.1.0) yajl-ruby (~> 1.1.0)
gitlab_git (1.0.5) gitlab_git (1.0.6)
activesupport (~> 3.2.13) activesupport (~> 3.2.13)
github-linguist (~> 2.3.4) github-linguist (~> 2.3.4)
grit (~> 2.5.0) grit (~> 2.5.0)
...@@ -518,7 +518,7 @@ DEPENDENCIES ...@@ -518,7 +518,7 @@ DEPENDENCIES
github-markup (~> 0.7.4) github-markup (~> 0.7.4)
gitlab-grack (~> 1.0.0) gitlab-grack (~> 1.0.0)
gitlab-pygments.rb (~> 0.3.2) gitlab-pygments.rb (~> 0.3.2)
gitlab_git (~> 1.0.5) gitlab_git (~> 1.0.6)
gitlab_meta (= 5.0) gitlab_meta (= 5.0)
gitlab_omniauth-ldap (= 1.0.2) gitlab_omniauth-ldap (= 1.0.2)
gollum-lib (~> 1.0.0) gollum-lib (~> 1.0.0)
......
...@@ -5,24 +5,18 @@ module TreeHelper ...@@ -5,24 +5,18 @@ module TreeHelper
# contents - A Grit::Tree object for the current tree # contents - A Grit::Tree object for the current tree
def render_tree(tree) def render_tree(tree)
# Render Folders before Files/Submodules # Render Folders before Files/Submodules
folders, files = tree.trees, tree.blobs folders, files, submodules = tree.trees, tree.blobs, tree.submodules
tree = "" tree = ""
# Render folders if we have any # Render folders if we have any
tree += render partial: 'tree/tree_item', collection: folders, locals: {type: 'folder'} if folders.present? tree += render partial: 'tree/tree_item', collection: folders, locals: {type: 'folder'} if folders.present?
files.each do |f| # Render files if we have any
html = if f.respond_to?(:url) tree += render partial: 'tree/blob_item', collection: files, locals: {type: 'file'} if files.present?
# Object is a Submodule
render partial: 'tree/submodule_item', object: f
else
# Object is a Blob
render partial: 'tree/blob_item', object: f, locals: {type: 'file'}
end
tree += html if html.present? # Render submodules if we have any
end tree += render partial: 'tree/submodule_item', collection: submodules if submodules.present?
tree.html_safe tree.html_safe
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment