From 1ead3cc307a7a8143a13e2debe5d4a2f6819a2b3 Mon Sep 17 00:00:00 2001 From: Gareth Evans Date: Sat, 28 Sep 2013 06:53:15 -0700 Subject: [PATCH] Set the CWD before applying a git patch Summary: If in a subdirectory, any changes made in a different location is missed from the patch with no errors from git. The other option was to run some logic to compare the files being changed. Test Plan: Run arc patch from a subdirectory that would miss some files previously. Reviewers: epriestley Reviewed By: epriestley CC: Korvin, aran Maniphest Tasks: T3733 Differential Revision: https://secure.phabricator.com/D7167 --- src/workflow/ArcanistPatchWorkflow.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/workflow/ArcanistPatchWorkflow.php b/src/workflow/ArcanistPatchWorkflow.php index 907e97f9..ce7b0f11 100644 --- a/src/workflow/ArcanistPatchWorkflow.php +++ b/src/workflow/ArcanistPatchWorkflow.php @@ -676,9 +676,11 @@ EOTEXT $patchfile = new TempFile(); Filesystem::writeFile($patchfile, $bundle->toGitPatch()); - $err = $repository_api->execPassthru( - 'apply --index --reject -- %s', + $passthru = new PhutilExecPassthru( + 'git apply --index --reject -- %s', $patchfile); + $passthru->setCWD($repository_api->getPath()); + $err = $passthru->execute(); if ($err) { echo phutil_console_format( -- 2.43.0