Skip to content
Browse files

View changes to render submodules.

  • Loading branch information...
1 parent 3124567 commit 5594a4075af045a8c372e3fe39ba46d426ecc5f9 @pwnall committed Apr 21, 2012
Showing with 16 additions and 8 deletions.
  1. +10 −4 app/views/trees/_tree.html.erb
  2. +3 −2 script/git_user/setup
  3. +3 −2 script/git_user/teardown
View
14 app/views/trees/_tree.html.erb
@@ -4,11 +4,17 @@
<span class="type">Type</span>
<span class="size">Size</span>
</li>
- <% tree.entries.select { |e| e.child.kind_of? Tree }.sort_by(&:name).each do |entry| %>
+ <% tree.entries.select { |e| !e.child.kind_of? Blob }.sort_by(&:name).each do |entry| %>
<li>
- <span class="name"><%= link_to entry.name, tree_path(tree_reference, File.join(tree_path, entry.name)) %>/</span>
- <span class="type">directory</span>
- <span class="size"><%= entry.child.entries.count %> entries</span>
+ <% if entry.child.kind_of? Tree %>
+ <span class="name"><%= link_to entry.name, tree_path(tree_reference, File.join(tree_path, entry.name)) %>/</span>
+ <span class="type">directory</span>
+ <span class="size"><%= entry.child.entries.count %> entries</span>
+ <% elsif entry.child.kind_of? Submodule %>
+ <span class="name"><%= entry.name %> at <%= entry.child.short_gitid %> </span>
+ <span class="type">submodule</span>
+ <span class="size"></span>
+ <% end %>
</li>
<% end %>
<% tree.entries.select { |e| e.child.kind_of? Blob }.sort_by(&:name).each do |entry| %>
View
5 script/git_user/setup
@@ -9,8 +9,9 @@ require 'pathname'
# Parameter processing.
if Process.euid != 0
- puts "This script needs to be run as superuser. Enter your password below."
- exec *(['sudo', $0] + ARGV)
+ exec *(['sudo', '-p',
+ 'This script needs to be run as superuser. Enter your password: ',
+ $0] + ARGV)
end
if ARGV.length != 2
View
5 script/git_user/teardown
@@ -8,8 +8,9 @@ require 'fileutils'
# Parameter processing.
if Process.euid != 0
- puts "This script needs to be run as superuser. Enter your password below."
- exec *(['sudo', $0] + ARGV)
+ exec *(['sudo', '-p',
+ 'This script needs to be run as superuser. Enter your password: ',
+ $0] + ARGV)
end
if ARGV.length != 2

0 comments on commit 5594a40

Please sign in to comment.
Something went wrong with that request. Please try again.