Method: Git::Lib#ls_files
- Defined in:
- lib/git/lib.rb
#ls_files(location = nil) ⇒ Hash<String, Hash>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
List all files that are in the index
974 975 976 977 978 979 980 981 982 983 984 985 |
# File 'lib/git/lib.rb', line 974 def ls_files(location = nil) location ||= '.' {}.tap do |files| command_lines('ls-files', '--stage', location).each do |line| (info, file) = split_status_line(line) (mode, sha, stage) = info.split files[file] = { path: file, mode_index: mode, sha_index: sha, stage: stage } end end end |