Skip to content

Internal refactor of Git::Lib command #618

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 4 commits into from
Feb 16, 2023
Merged

Conversation

jcouball
Copy link
Member

@jcouball jcouball commented Feb 15, 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

In order to support moving to using a spawn like interface for calling git commands in a subprocess (rather than backticks), make the following changes to Git::Lib#command:

  • Collapse the cmd parameter and the opts parameter into a single Array parameter named cmd
  • Do not allow the cmd parameter to have nested arrays. Enforce that it is an Array of Strings only by raising an ArgumentError when cmd is anything other than an Array of Strings.
  • Options that apply to how #command works (and are not passed on to the git command like redirect and chomp) should be passed as keyword parameters to #command instead of a Hash at the end of the cmd / opts Array parameter.

These changes impact both the implementation of Git::Lib#command as well as its callers.

@jcouball jcouball merged commit 872de4c into master Feb 16, 2023
@jcouball jcouball deleted the refactor_lib_command branch February 16, 2023 01:10
@jcouball jcouball mentioned this pull request Feb 26, 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.

1 participant