Commit 726847cb6184017dc92ef951bf2ff9e5fa7b50d8

don't show commit diff for the initial commit, link to the tree instead

Commit diff

app/controllers/browse_controller.rb

 
3333 if @commit.parent
3434 @diff = @git.diff(@commit.parent.sha || "", @commit.sha)
3535 else
36 # initial commit
37 @diff = @commit.diff("") # fIXME: diffs are the wrong way
36 # initial commit, link to the initial tree instead
37 @diff = nil
3838 end
3939 @comment_count = @repository.comments.count(:all, :conditions => {:sha1 => @commit.sha})
4040 end
toggle raw diff

app/views/browse/commit.html.erb

 
1414
1515<% #TODO: commit diff stats (as sparklines?) -%>
1616
17<h2>Commit diff</h2>
18<%= render_diffmode_selector -%>
19
20<% @diff.each do |file| -%>
21 <h4><%= h(file.path) -%><%#=link_to h(file.path), blob_path(file.sha, file.path) -%></h4>
22 <%= render_diff(file.patch, file.src, file.dst, @diffmode) -%>
23 <small><%= link_to_function "toggle raw diff", "$('#{file.object_id}').toggle()" -%></small>
24 <div class="toggle_diff" style="display:none" id="<%= file.object_id -%>">
25 <p><pre><%= h(file.patch) -%></pre></p>
26 </div>
17<% if @diff.blank? -%>
18 <p>
19 This is the initial commit in this repository,
20 <%= link_to "browse the initial tree state", tree_path(@commit.gtree.sha) -%>.
21 </p>
22<% else -%>
23 <h2>Commit diff</h2>
24 <%= render_diffmode_selector -%>
25
26 <% @diff.each do |file| -%>
27 <h4><%= h(file.path) -%><%#=link_to h(file.path), blob_path(file.sha, file.path) -%></h4>
28 <%= render_diff(file.patch, file.src, file.dst, @diffmode) -%>
29 <small><%= link_to_function "toggle raw diff", "$('#{file.object_id}').toggle()" -%></small>
30 <div class="toggle_diff" style="display:none" id="<%= file.object_id -%>">
31 <p><pre><%= h(file.patch) -%></pre></p>
32 </div>
33 <% end -%>
2734<% end -%>
2835
2936<%= render :partial => "submenu" -%>
toggle raw diff