1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-10 08:52:39 +01:00

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
This commit is contained in:
Gareth Evans 2013-09-28 06:53:15 -07:00 committed by epriestley
parent 08536d8917
commit 1ead3cc307

View file

@ -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(