summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG1
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock4
-rw-r--r--app/helpers/tree_helper.rb16
4 files changed, 9 insertions, 14 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 01ddc771777..f01b5e87c5e 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -8,6 +8,7 @@ v 5.2.0
- Move Gitlab::Git code to gitlab_git gem
- Move update docs in repo
- requires gitlab-shell v1.4.0
+ - fixed submodules listing under file tab
v 5.1.0
- You can login with email or username now
diff --git a/Gemfile b/Gemfile
index a2317248b81..bccde6664dd 100644
--- a/Gemfile
+++ b/Gemfile
@@ -24,7 +24,7 @@ gem 'omniauth-github'
# Extracting information from a git repository
# We cannot use original git since some bugs
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
gem 'gitlab-grack', '~> 1.0.0', require: 'grack'
diff --git a/Gemfile.lock b/Gemfile.lock
index a6c2b6a7fd4..c06a1bd09cc 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -165,7 +165,7 @@ GEM
gitlab-pygments.rb (0.3.2)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.1.0)
- gitlab_git (1.0.5)
+ gitlab_git (1.0.6)
activesupport (~> 3.2.13)
github-linguist (~> 2.3.4)
grit (~> 2.5.0)
@@ -518,7 +518,7 @@ DEPENDENCIES
github-markup (~> 0.7.4)
gitlab-grack (~> 1.0.0)
gitlab-pygments.rb (~> 0.3.2)
- gitlab_git (~> 1.0.5)
+ gitlab_git (~> 1.0.6)
gitlab_meta (= 5.0)
gitlab_omniauth-ldap (= 1.0.2)
gollum-lib (~> 1.0.0)
diff --git a/app/helpers/tree_helper.rb b/app/helpers/tree_helper.rb
index e7002f60b8a..1f764ea1038 100644
--- a/app/helpers/tree_helper.rb
+++ b/app/helpers/tree_helper.rb
@@ -5,24 +5,18 @@ module TreeHelper
# contents - A Grit::Tree object for the current tree
def render_tree(tree)
# Render Folders before Files/Submodules
- folders, files = tree.trees, tree.blobs
+ folders, files, submodules = tree.trees, tree.blobs, tree.submodules
tree = ""
# Render folders if we have any
tree += render partial: 'tree/tree_item', collection: folders, locals: {type: 'folder'} if folders.present?
- files.each do |f|
- html = if f.respond_to?(:url)
- # 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
+ # Render files if we have any
+ tree += render partial: 'tree/blob_item', collection: files, locals: {type: 'file'} if files.present?
- tree += html if html.present?
- end
+ # Render submodules if we have any
+ tree += render partial: 'tree/submodule_item', collection: submodules if submodules.present?
tree.html_safe
end