From 0d271a0c44117d4ba80ea9c2d97519f22b01e3bc Mon Sep 17 00:00:00 2001 From: Glenn Pratt Date: Mon, 4 Apr 2011 10:52:48 -0700 Subject: [PATCH] Issue #745224: Change patch command to handle patches from git diff and git format-patch. --- drush_make.project.inc | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drush_make.project.inc b/drush_make.project.inc index 3359046..0276422 100644 --- a/drush_make.project.inc +++ b/drush_make.project.inc @@ -72,7 +72,12 @@ class DrushMakeProject { } // Download the patch. if ($filename = _drush_make_download_file($info)) { - $patched = drush_shell_exec("patch -p0 -d %s < %s", $this->project_directory, $filename); + // Apply a patch as recommended for Git @see http://drupal.org/node/1054616 + $patched = drush_shell_exec("patch -p1 -d %s < %s", $this->project_directory, $filename); + // Try -p0 for non-Git patches. + if (!$patched) { + $patched = drush_shell_exec("patch -p0 -d %s < %s", $this->project_directory, $filename); + } if ($patched) { if (!$ignore_checksums && !_drush_make_verify_checksums($info, $filename)) { return FALSE; -- 1.7.0.4