lib/monkey_patches.rb in modulesync-0.8.2 vs lib/monkey_patches.rb in modulesync-0.9.0
- old
+ new
@@ -35,6 +35,21 @@
end
end
final.map { |e| [e[0], DiffFile.new(@base, e[1])] }
end
end
+
+ class Lib
+ # Monkey patch ls_files until https://github.com/ruby-git/ruby-git/pull/320 is resolved
+ def ls_files(location=nil)
+ location ||= '.'
+ hsh = {}
+ command_lines('ls-files', ['--stage', location]).each do |line|
+ (info, file) = line.split("\t")
+ (mode, sha, stage) = info.split
+ file = eval(file) if file =~ /^\".*\"$/ # This takes care of quoted strings returned from git
+ hsh[file] = {:path => file, :mode_index => mode, :sha_index => sha, :stage => stage}
+ end
+ hsh
+ end
+ end
end