Skip to content
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

Fix error when calling Git::Lib#remove with recursive or cached options #632

Merged
merged 3 commits into from
Mar 1, 2023

Conversation

gtnao
Copy link
Contributor

@gtnao gtnao commented Mar 1, 2023

Your checklist for this pull request

🚨Please review the guidelines for contributing to this repository.

  • Ensure all commits include DCO sign-off.
  • Ensure that your contributions pass unit testing.
  • Ensure that your contributions contain documentation if applicable.

Description

Calling Git::Lib#remove with recursive or cached option causes nested array assignment to cmd argument of Git::Lib#command and throws exception.
It is caused by passing an array to Array#<<.

fix #631

…array. Signed-off-by: Naotaka Nakane <n.nakane0219@gmail.com>

Signed-off-by: naotaka nakane <n.nakane0219@gmail.com>
@gtnao gtnao force-pushed the fix-remove-with-recursive-or-cached branch from 97ad381 to 9be6dc7 Compare March 1, 2023 09:57
Signed-off-by: James Couball <jcouball@yahoo.com>
@jcouball
Copy link
Member

jcouball commented Mar 1, 2023

Hello @gtnao0219! Thank you for reporting and fixing this bug!

This points out that we don't have test coverage for #remove so I added that to this PR.

In addition, I renamed #remove to #rm since we are trying to keep this library aligned with the actual git command line command. I have aliased via alias remove rm so that existing code is not broken.

Signed-off-by: James Couball <jcouball@yahoo.com>
@jcouball jcouball merged commit 9c5e0c6 into ruby-git:master Mar 1, 2023
@jcouball jcouball mentioned this pull request Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't use Git::Lib#remove with recursive or cached options
2 participants