Skip to content

Commit

Permalink
Removed unnecessary commit-ordering code.
Browse files Browse the repository at this point in the history
  • Loading branch information
cowboy committed Feb 13, 2011
1 parent bcfe244 commit 8e76bc7
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions lib/gaucho/pageset.rb
Expand Up @@ -105,30 +105,21 @@ def abs_subdir_path
end
end

# Sort commits. TODO: REMOVE?
def sort_commits(shas)
shas.sort {|a, b| @commit_order[a].to_i <=> @commit_order[b].to_i}
end

protected

# Build commit index for this repo.
def build_commit_index
return if @commits_by_page

@commit_order = {}
@commits_by_page = {}

current_id = nil
idx = 0

log = repo.git.native(:log, {pretty: 'oneline', name_only: true,
reverse: true, timeout: false})

log.split("\n").each do |line|
if line =~ /^([0-9a-f]{40})/
current_id = $1
@commit_order[current_id] = idx += 1
else
if line =~ %r{^#{subdir_path}(.*?)/}
@commits_by_page[$1] ||= []
Expand Down

0 comments on commit 8e76bc7

Please sign in to comment.