Method: Git::Lib#ls_files
- Defined in:
- lib/git/lib.rb
#ls_files(location = nil) ⇒ Object
399 400 401 402 403 404 405 406 407 408 409 |
# File 'lib/git/lib.rb', line 399 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 |