Skip to content
This repository has been archived by the owner on May 8, 2018. It is now read-only.

Commit

Permalink
Fixes that current_list is nil when calling Array#[] with indicies th…
Browse files Browse the repository at this point in the history
…at are out of range.
  • Loading branch information
Brian Donovan committed Mar 26, 2009
1 parent 6a5b8e5 commit 2b6b084
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/diff_to_html.rb
Expand Up @@ -256,7 +256,7 @@ def diff_between_revisions(rev1, rev2, repo, branch)
previous_file = THIS_FILE ? File.join(File.dirname(THIS_FILE), "../config/previously.txt") : "/tmp/previously.txt"
previous_list = (File.read(previous_file).split("\n") if File.exist?(previous_file)) || []
commits.reject!{|c| c.find{|sha| previous_list.include?(sha)} }
current_list = (previous_list + commits.flatten)[-1000..-1]
current_list = (previous_list + commits.flatten).last(1000)
File.open(previous_file, "w"){|f| f << current_list.join("\n") } unless current_list.empty?

commits.each_with_index do |commit, i|
Expand Down

0 comments on commit 2b6b084

Please sign in to comment.