Permalink
Browse files

Make sure we don't include the newlines in previous_list.

  • Loading branch information...
1 parent 2b6b084 commit d145fd986286ad7da06d86bfba59e2c43065fb72 Brian Donovan committed Mar 26, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/diff_to_html.rb
View
@@ -254,7 +254,7 @@ def diff_between_revisions(rev1, rev2, repo, branch)
end
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)) || []
+ previous_list = (File.read(previous_file).to_a.map {|sha| sha.chomp!} if File.exist?(previous_file)) || []
commits.reject!{|c| c.find{|sha| previous_list.include?(sha)} }
current_list = (previous_list + commits.flatten).last(1000)
File.open(previous_file, "w"){|f| f << current_list.join("\n") } unless current_list.empty?

0 comments on commit d145fd9

Please sign in to comment.