Repository navigation
Require gitlib 1.7 and fix its deprecations - #1237
Merged
Merged
Conversation
Contributor
|
@lyrixx Looks good. So do I understand it correctly that I should tag this one and then later on the 2.x support? Or how do you see this? |
Contributor
Author
I think it's a good idea 👍🏼 After, there is no rush to upgrade to gitlib 2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitRepositoryandGitRepositoryLocator::locate(), see belowgitlib 1.7 prepares the upgrade to 2.0: it has the API of 2.0 that 1.x can get, and deprecates
what 2.0 replaces. GrumPHP runs with 1.7 as is, but triggers two deprecations:
new Repository()with an array of options: the working directory is now its second argument,and a
CliDriverconfigures git, with the logger;Diff::setRepository():Diff::parse()takes the repository.This PR fixes both. Without deprecations with 1.7, GrumPHP runs with 2.0 with the same code: a
^1.7 || ^2.0constraint will be enough, without branching on the version of gitlib.CliDriverhas no counterpart forinherit_environment_variables: Symfony Process makes gitinherit the environment variables anyway. git still gets the variables of the
environmentconfiguration (Dotenv sets them in
$_ENVand$_SERVER) and thePATHGrumPHP prepends to;it no longer gets the entries of
$_SERVERthat aren't environment variables (PHP_SELF,SCRIPT_NAME...).GitRepositorytakes theCliDriverinstead of the array of options, and passes it toGitRepositoryLocator::locate(). The container builds both.Tested in a repository with
git:pre-commit(stashing the unstaged changes),run, and a diff onstdin: no deprecation anymore, two before.