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

Move hash, phpcs, and root git commands to ShellOperator #75

Merged
merged 13 commits into from
May 7, 2023

Conversation

sirbrillig
Copy link
Owner

@sirbrillig sirbrillig commented May 6, 2023

This moves a bunch of git commands to the ShellOperator interface so they can be customized for a different OS. Specifically this moves:

  • The code to determine the hash of a git file.
  • The code to get the phpcs output of a git file.
  • The code to get the git root directory (this was removed actually because I think we can safely always use the git file's full path).
  • The code to check if the unmodified file is in git.

This also removes the initial validation of the git file's existence in the repo since that can be handled when we try to fetch the file's full path.

Since this increases the number of times we get the git file's full path, we also cache the full path for the lifetime of the script.

This is part of #73

@sirbrillig sirbrillig marked this pull request as ready for review May 7, 2023 00:08
@sirbrillig sirbrillig merged commit c266750 into trunk May 7, 2023
@sirbrillig sirbrillig deleted the add-lots-more-git-commands-to-shell branch May 7, 2023 00:16
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