1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 16:22:42 +01:00

Raise a better error message when "arc patch" fails because of filename case changes

Summary: Git can't apply filename case change patches on case-insensitive filesystems. Some day we could manually do this ourselves, but it's fairly rare and complicated -- just raise a useful warning.

Test Plan: Tried to apply a case-changing patch, got a good error.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, epriestley

Maniphest Tasks: T618

Differential Revision: https://secure.phabricator.com/D2015
This commit is contained in:
epriestley 2012-03-26 09:43:37 -07:00
parent 4ca58d1129
commit b67ce7e534

View file

@ -581,7 +581,24 @@ EOTEXT
$future = $repository_api->execFutureLocal(
'apply --index --reject');
$future->write($bundle->toGitPatch());
try {
$future->resolvex();
} catch (CommandException $ex) {
echo phutil_console_format(
"\n<bg:red>** Patch Failed! **</bg>\n");
$stderr = $ex->getStdErr();
if (preg_match('/already exists in working directory/', $stderr)) {
echo phutil_console_wrap(
phutil_console_format(
"\n<bg:yellow>** WARNING **</bg> This patch may have failed ".
"because it attempts to change the case of a filename (for ".
"instance, from 'example.c' to 'Example.c'). Git can not apply ".
"patches like this on case-insensitive filesystems. You must ".
"apply this patch manually.\n"));
}
throw $ex;
}
if ($this->shouldCommit()) {
$commit_message = $this->getCommitMessage($bundle);