Skip to content

Commit

Permalink
allow ls_files to take a subdirectory argument
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanlarsen authored and technicalpickles committed Oct 17, 2009
1 parent 1987b50 commit cf01e25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/git/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/git/lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cf01e25

Please sign in to comment.