diff --git a/src/Patches.php b/src/Patches.php index d51fac15..31f5225c 100644 --- a/src/Patches.php +++ b/src/Patches.php @@ -369,7 +369,14 @@ protected function getAndApplyPatch(RemoteFilesystem $downloader, $install_path, // Download file from remote filesystem to this location. $hostname = parse_url($patch_url, PHP_URL_HOST); - $downloader->copy($hostname, $patch_url, $filename, FALSE); + + try { + $downloader->copy($hostname, $patch_url, $filename, false); + } catch (\Exception $e) { + // In case of an exception, retry once as the download might + // have failed due to intermittent network issues. + $downloader->copy($hostname, $patch_url, $filename, false); + } } // The order here is intentional. p1 is most likely to apply with git apply.