Browse files

Deal with empty lines in the input and recognize file names with dashes.

  • Loading branch information...
1 parent a503f63 commit 8092e1a4b3324a094bdefd16e5f525f36ce35336 @zszugyi committed May 16, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 filterdiff.rb
View
4 filterdiff.rb
@@ -3,7 +3,7 @@
# filterdiff.rb -f=files.txt changes.diff
# filterdiff.rb < changes.diff -- Assumes files.txt
-@files_to_accept = Set.new(File.open($f || "files.txt").each_line.map &:strip) unless @files_to_accept
+@files_to_accept = (Set.new(File.open($f || "files.txt").each_line.map &:strip) - ['']) unless @files_to_accept
-last_filename = $~[:filename] if /^Index:\s+(?<filename>[\w\/.]*)$/
+last_filename = $~[:filename] if /^Index:\s+(?<filename>[\w\/.-]*)$/
puts $_ if @files_to_accept.include? last_filename

0 comments on commit 8092e1a

Please sign in to comment.