Permalink
Browse files

allow ls_files to take a subdirectory argument

  • Loading branch information...
1 parent 1987b50 commit cf01e252dbcfce315697b80cd38714f8e1939814 @bryanlarsen bryanlarsen committed with technicalpickles Oct 13, 2009
Showing with 4 additions and 4 deletions.
  1. +2 −2 lib/git/base.rb
  2. +2 −2 lib/git/lib.rb
View
@@ -426,8 +426,8 @@ def update_ref(branch, commit)
end
- def ls_files
- self.lib.ls_files
+ def ls_files(location=nil)
+ self.lib.ls_files(location)
end
def with_working(work_dir) # :yields: the Git::WorkingDirectory
View
@@ -293,9 +293,9 @@ def diff_index(treeish)
hsh
end
- def ls_files
+ def ls_files(location=nil)
hsh = {}
- command_lines('ls-files', '--stage').each do |line|
+ 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

0 comments on commit cf01e25

Please sign in to comment.