lib/git/modified.rb in git-modified-0.2.0 vs lib/git/modified.rb in git-modified-0.2.1
- old
+ new
@@ -30,10 +30,13 @@
end
end
Contract nil => nil
def self.show_modified_files_on_working_tree
- puts `git status --porcelain`.each_line.map { |x| x[3..-1] }
+ puts `git status --porcelain` \
+ .each_line \
+ .reject { |line| line[0..1].split('').lazy.any? { |x| x == 'D' } } \
+ .map { |line| line[3..-1] }
end
Contract Maybe[String] => nil
def self.show_modified_files_on_commit(hash)
hashes = `git show --summary --format="%P" #{hash} | head -n 1`.split ' '