Skip to content

Fix ls-files for git 2.16 #350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/git/lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ def diff_index(treeish)
end

def ls_files(location=nil)
location ||= '.'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not do this in the method arguments?

def ls_files(location='.')
...
end

Copy link
Contributor Author

@rafamanzo rafamanzo Mar 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay, I got no notification of your review. Thanks in advance :)

I thought about doing this, but then on ls_remote it was handled this way, so I kept the standard of code that was already there.

Having 2 standards seemed a bad idea to me. Also modifying ls_remote which is not subject of this PR didn't feel right.

But if you think it is not a problem modifying just here, I can change it. What do you think is best?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct about maintaining the standards. I had not seen ls_remote for my various use cases.

👍

hsh = {}
command_lines('ls-files', ['--stage', location]).each do |line|
(info, file) = line.split("\t")
Expand Down