From ae40dfa1dc29f36e41a9606c665d19c398c7fc8f Mon Sep 17 00:00:00 2001 From: Gudmundur Bjarni Olafsson Date: Wed, 14 Dec 2016 13:56:03 +0100 Subject: [PATCH] Set default location to . If we pass in nil, git will output a warning about empty strings in pathspec. See: https://github.com/git/git/commit/d426430e6ec2a05bf0a4ee88c319dd6072908504 --- lib/git/lib.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/git/lib.rb b/lib/git/lib.rb index 777e42ea..00cc0e72 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -396,6 +396,7 @@ def diff_index(treeish) end def ls_files(location=nil) + location ||= '.' hsh = {} command_lines('ls-files', ['--stage', location]).each do |line| (info, file) = line.split("\t")