lib/git/modified.rb in git-modified-0.2.1 vs lib/git/modified.rb in git-modified-0.2.2
- old
+ new
@@ -33,10 +33,11 @@
Contract nil => nil
def self.show_modified_files_on_working_tree
puts `git status --porcelain` \
.each_line \
.reject { |line| line[0..1].split('').lazy.any? { |x| x == 'D' } } \
- .map { |line| line[3..-1] }
+ .reject { |line| line.match /\.(jpe?g|png|gif|svg|eot|mp3|ttf|wav|wof)$/i } \
+ .map { |line| if line[0] == 'R' then line.split(' ')[-1] else line[3..-1] end }
end
Contract Maybe[String] => nil
def self.show_modified_files_on_commit(hash)
hashes = `git show --summary --format="%P" #{hash} | head -n 1`.split ' '