Skip to content

Commit

Permalink
Fixes cweagans#174: Compatibility with older Git versions
Browse files Browse the repository at this point in the history
  • Loading branch information
stucki committed Jul 13, 2018
1 parent 8fec601 commit 2eb28aa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Plugin/Patches.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,12 @@ protected function isPatchingEnabled()
*/
protected function applyPatchWithGit($install_path, $patch_levels, $filename)
{
// Do not use git apply unless the install path is itself a git repo
// @see https://stackoverflow.com/a/27283285
if (!is_dir($install_path . '/.git')) {
return FALSE;
}

foreach ($patch_levels as $patch_level) {
if ($this->io->isVerbose()) {
$comment = 'Testing ability to patch with git apply.';
Expand Down

0 comments on commit 2eb28aa

Please sign in to comment.